Maven structor - how shall i make this the right way?
I am sitting with a problem on how to structor a maven project.
This is the structur on the project
So I am able to build every project like bbbbb/pom.xml and so on. Fx the bbbb/pom.xml has a parent that i开发者_Go百科s in aaaaaa/parent/pom.xml. Then this has a parent in the root. But if I now want to build them all and add them all to a package how is that done?
Usual structure for nested maven projects would be:
/parent
pom.xml
/sub1
pom.xml
/sub2
pom.xml
...
Each pom in subX prohect references parent and parent pom lists SubX as modules. This way you should be able to build each subX project individually as well as everything from parent.
Not clear what you mean by 'add them all to a package'? Generally in maven there is 'one artifact per project' - so if you need say EAR you would create another subproject under same parent with packaging=ear. If you need 'all in one jar' you could look at maven-assembly-plugin, again in separate subproject perhaps.
精彩评论