0

In svn repository I have a folder 'product' under which are all my Eclipse plugins and features, parallel to these there is parent POM. This setup works well when I build in Jenkins, I just check out 'product' and install pom.xml. However, I can't figure out how this setup works in Eclipse workspace? I can't check out pom.xml by itself into workspace, and if I do I need to check it out as single file under a project which brakes path to parent POM. How should I check out and build in such setup?

Also, do I need to define relativePath of parent POM in my plugins? I found that if I omit it, then I get error about path being missing.

Just to summarize, my svn repository structure is this:

  • repo/
    • trunk/
      • product <- maven project (folder with .project set as maven nature)
        • pluginA
        • pluginB
        • featureA
        • pom.xml
        • .project
positron
  • 3,643
  • 3
  • 22
  • 26

2 Answers2

0

I think you have two options:

  1. Deploy your parent POM to a locally available repository, perhaps your company Nexus server, for example? This will then be available to all products and for all your colleagues.

  2. Restructure your project to look more Maven-like, e.g.

    |-- plugin1
       |-- pom.xml
       |-- ....
    |-- plugin2...
    |-- feature1...
    |-- ...
    pom.xml  <-- parent POM
    

    This second option may be better in the long term, otherwise your Jenkins server relies on you remembering to locally install the updated parent POM, rather than just plucking it from svn.

Duncan Jones
  • 67,400
  • 29
  • 193
  • 254
  • Thanks. I restructured by project initially because I figured that's the best way Maven works. Before I had plugins and features in /plugins and /features folders. However that structure was a bit difficult to work with, but now I think I might not have referenced parent POM correctly because I believe even with that structure Maven can find parent POM by correct GAV, is that correct assumption? – positron Dec 07 '12 at 18:15
0

If you use m2eclipse (e.g. available from the Juno site), you can import any Maven project structure into Eclipse. In your case, the product folder would be imported as an Eclipse project, as well as the individual features and bundles.

<relativePath> defaults to .., so you need to specify it if the parent POM is not in the parent folder. You can set it to undefined (e.g. through an empty <relativePath/> tag) if the parent POM is not available locally. In this case, Maven will always resolve the parent POM from the local Maven repository or the configured remote (Maven) repositories.

oberlies
  • 11,503
  • 4
  • 63
  • 110
  • Thanks. I imported product project through Maven SCM wizard. This imported all my plugins and features as Java projects and also imported product project along with all my java projects as its children. Did I do something wrong during import by not checking appropriate actions? I pointed SCM to my parent folder which has Maven nature. – positron Dec 07 '12 at 18:02