0

Let's say I have a bunch of maven modules, each with its own trunk/branches/tags. Picture something like the following.

portal_root
    +project1
        +tags
        +branches
        +trunk
    +project2
        .
        .
        .
    +parent
    pom.xml

If following the structure suggested in the answer to multi module maven project with parent pom and svn layout I would have the parent project at the same level as the child projects, and reference it by relative paths. However, I believe this complicates the release policy considerably.

Considering that the source was copied from trunk to tags/v*/, the relative path to the parent is no longer valid: compare ../parent/ with ../../parent. Furthermore, there is no valid parent for the tagged child, since the old parent references trunk. This leads me to the question: what is the maven best practice to build the tagged source for a module with its own SCM heirarchy?

Community
  • 1
  • 1
nwb
  • 653
  • 1
  • 5
  • 12

1 Answers1

0

Rather than using relative path, consider building, and distributing your parent artifact on a company Nexus repository (or locally on each developer local maven repo if your team is small).

Then reference this parent using standard maven coordinate, maven will try to resolve it as it were a dependency.

However this means when you make changes to parent you have to update all downstream artifacts so the changes take effect

gerrytan
  • 40,313
  • 9
  • 84
  • 99