Note that there are some explanatory texts on larger screens.

plurals
  1. POMaven parent pom vs modules pom
    primarykey
    data
    text
    <p>There seem to be several ways to structure parent poms in a multiproject build and I wondering if anyone had any thoughts on what the advantages / drawbacks are in each way.</p> <p>The simplest method of having a parent pom would be putting it in the root of a project i.e.</p> <pre><code>myproject/ myproject-core/ myproject-api/ myproject-app/ pom.xml </code></pre> <p>where the pom.xml is both the parent project as well as describes the -core -api and -app modules</p> <p>The next method is to separate out the parent into its own subdirectory as in</p> <pre><code>myproject/ mypoject-parent/ pom.xml myproject-core/ myproject-api/ myproject-app/ </code></pre> <p>Where the parent pom still contains the modules but they're relative, e.g. ../myproject-core</p> <p>Finally, there's the option where the module definition and the parent are separated as in</p> <pre><code>myproject/ mypoject-parent/ pom.xml myproject-core/ myproject-api/ myproject-app/ pom.xml </code></pre> <p>Where the parent pom contains any "shared" configuration (dependencyManagement, properties etc.) and the myproject/pom.xml contains the list of modules.</p> <p>The intention is to be scalable to a large scale build so should be scalable to a large number of projects and artifacts.</p> <p>A few bonus questions:</p> <ul> <li>Where is the best place to define the various shared configuration as in source control, deployment directories, common plugins etc. (I'm assuming the parent but I've often been bitten by this and they've ended up in each project rather than a common one).</li> <li>How do the maven-release plugin, hudson and nexus deal with how you set up your multi-projects (possibly a giant question, it's more if anyone has been caught out when by how a multi-project build has been set up)?</li> </ul> <p>Edit: Each of the sub projects have their own pom.xml, I've left it out to keep it terse.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload