Modify build order?
I have the following projects (physically separated in svn) with the following structure: a |--> a.parent |--> pom.xml ... |--> a.child |--> pom.xml b |--> b.parent |--> pom.xml ... |--> b.child |--> pom.xml c |--> c.parent |--> pom.xml ... |--> c.child |--> pom.xml Now I would like to create an "aggregator" project where I can specify the order of how the above project (and their submodules) should be build, eg.: my.aggregator.build: a b c or: my.aggregator.build: b a c The problem is that the standard aggregator implementation: http://maven.apache.org/pom.html#Aggregation automatically computes the "right" order but I cannot use that since my interdependent projects does not have a fixed structure - a longer story. So is it possible to "hardcode" the order that projects should be build in a master pom file? - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Modify build order?
Take a look at the invoker-plugin, goal 'run' [1]. Roland [1] http://maven.apache.org/plugins/maven-invoker-plugin/run-mojo.html On 04.05.2011 14:56, motes motes wrote: > I have the following projects (physically separated in svn) with the > following structure: > > a > |--> a.parent > |--> pom.xml > ... > |--> a.child > |--> pom.xml > > > > b > |--> b.parent > |--> pom.xml > ... > |--> b.child > |--> pom.xml > > > c > |--> c.parent > |--> pom.xml > ... > |--> c.child > |--> pom.xml > > > Now I would like to create an "aggregator" project where I can specify > the order of how the above project (and their submodules) should be > build, eg.: > > my.aggregator.build: > > a > b > c > > or: > > > > my.aggregator.build: > > b > a > c > > > > The problem is that the standard aggregator implementation: > > http://maven.apache.org/pom.html#Aggregation > > automatically computes the "right" order but I cannot use that since > my interdependent projects does not have a fixed structure - a longer > story. > > So is it possible to "hardcode" the order that projects should be > build in a master pom file? > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > -- Roland Asmann Senior Software Engineer adesso Austria GmbH Floridotower 26. Stock T +43 1 2198790-27 Floridsdorfer Hauptstr. 1 F +43 1 2198790-927 A-1210 Wien M +43 664 88657566 E roland.asm...@adesso.at W www.adesso.at - >>> business. people. technology. <<< - - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Modify build order?
Yeah I tried to specify a new project containing a pom.xml like the one specified here: http://maven.apache.org/plugins/maven-invoker-plugin/examples/prepare-build-env.html But the a.parent project never gets triggered though. The master project/pom file (basically just a folder containing a single pom.xml file): maven-invoker-plugin 1.5 ../a.parent/pom.xml ../b.parent/pom.xml */pom.xml integration-test run I build the master project inside the folder using mvn clean install. I have also tried to change : run to install The build succeeds but the a.parent and b.parent projects never gets build/triggered. -- View this message in context: http://maven.40175.n5.nabble.com/Modify-build-order-tp4369751p4369811.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Modify build order?
I now added the master pom as a common parent for the below parent project poms: master |--> pom.xml (reference below parent projects as relative submodules) a |--> a.parent |--> pom.xml (parent for this pom is the master pom.xml) ... |--> a.child |--> pom.xml b |--> b.parent |--> pom.xml (parent for this pom is the master pom.xml) ... |--> b.child |--> pom.xml c |--> c.parent |--> pom.xml (parent for this pom is the master pom.xml) ... |--> c.child |--> pom.xml Now it runs the invoker plugin: [INFO] --- [INFO] Reactor Build Order: [INFO] [INFO] Master project [INFO] M3 C Parent Project [INFO] C Bundle [INFO] M3 B Parent Project [INFO] B Bundle [INFO] M3 A Parent Project [INFO] A Bundle [INFO] but it has no effect. I specify that it should run b.parent before any other projects: maven-invoker-plugin 1.5 ../m3.b.parent/pom.xml */pom.xml integration-test run It seems that the only thing that has an effect on the order is the order specified in the tag: ... Master project 0.11.0 ../m3.c.parent ../m3.b.parent ../m3.a.parent ... result: [INFO] Reactor Summary: [INFO] [INFO] Master project SUCCESS [0.661s] [INFO] M3 C Parent Project ... SUCCESS [0.633s] [INFO] C Bundle .. SUCCESS [1.202s] [INFO] M3 B Parent Project ... SUCCESS [0.013s] [INFO] B Bundle .. SUCCESS [0.140s] [INFO] M3 A Parent Project ... SUCCESS [0.013s] [INFO] A Bundle .. SUCCESS [0.126s] [INFO] [INFO] BUILD SUCCESS I don't use the maven dependency manager since the projects are maven3/tycho MANIFEST first projects. Further parent/child relations are specified using relative paths in parent/module tags: master m3 1.0.0-SNAPSHOT ../m3.master 4.0.0 m3 b.parent 1.0.0-SNAPSHOT pom M3 B Parent Project ../m3.b.bundle Is this the reason that maven3 falls back to use the order in the modules tag when determining the effective build order? -- View this message in context: http://maven.40175.n5.nabble.com/Modify-build-order-tp4369751p4370836.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Modify build order?
I have never used the 'setupInclude' and 'pomInclude' myself, I use something along these lines: maven-invoker-plugin clean install ${java.home} true true ${file.encoding} ${user.language} ${eclipse.build} ${eclipse.install} ${eclipse.workspace} equest-pom run install ../../poms/equest/pom.xml maven-plugins run install ../../maven-plugins/pom.xml The configuration part may not be completely necessary for you (eg javaHome), but I just included it the way I use it. Roland On 04.05.2011 21:29, morty wrote: > I now added the master pom as a common parent for the below parent project > poms: > > master > |--> pom.xml (reference below parent projects as relative submodules) > > a > |--> a.parent > |--> pom.xml (parent for this pom is the master pom.xml) > ... > |--> a.child > |--> pom.xml > > > > b > |--> b.parent > |--> pom.xml (parent for this pom is the master pom.xml) > ... > |--> b.child > |--> pom.xml > > > c > |--> c.parent > |--> pom.xml (parent for this pom is the master pom.xml) > ... > |--> c.child > |--> pom.xml > > > Now it runs the invoker plugin: > > [INFO] > --- > [INFO] Reactor Build Order: > [INFO] > [INFO] Master project > [INFO] M3 C Parent Project > [INFO] C Bundle > [INFO] M3 B Parent Project > [INFO] B Bundle > [INFO] M3 A Parent Project > [INFO] A Bundle > [INFO] > > > > but it has no effect. I specify that it should run b.parent before any other > projects: > > > maven-invoker-plugin > 1.5 > > > ../m3.b.parent/pom.xml > > > */pom.xml > > > > > integration-test > > run > > > > > > > > > > It seems that the only thing that has an effect on the order is the order > specified in the tag: > > ... > Master project > > 0.11.0 > > > ../m3.c.parent > ../m3.b.parent > ../m3.a.parent > > ... > > result: > > [INFO] Reactor Summary: > [INFO] > [INFO] Master project SUCCESS [0.661s] > [INFO] M3 C Parent Project ... SUCCESS [0.633s] > [INFO] C Bundle .. SUCCESS [1.202s] > [INFO] M3 B Parent Project ... SUCCESS [0.013s] > [INFO] B Bundle .. SUCCESS [0.140s] > [INFO] M3 A Parent Project ... SUCCESS [0.013s] > [INFO] A Bundle .. SUCCESS [0.126s] > [INFO] > > [INFO] BUILD SUCCESS > > > > I don't use the maven dependency manager since the projects are maven3/tycho > MANIFEST first projects. Further parent/child relations are specified using > relative paths in parent/module tags: > > > master > m3 > 1.0.0-SNAPSHOT > ../m3.master > > > 4.0.0 > m3 > b.parent > 1.0.0-SNAPSHOT > pom > M3 B Parent Project > > ../m3.b.bundle > > > > Is this the reason that maven3 falls back to use the order in the modules > tag when determining the effective build order? > > > -- > View this message in context: > http://maven.40175.n5.nabble.com/Modify-build-order-tp4369751p4370836.html > Sent from the Maven - Users mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > -- Roland Asmann Senior Software Engineer adesso Austria GmbH Floridotower 26. Stock T +43 1 2198790-27 Floridsdorfer Hauptstr. 1 F +43 1 2198790-927 A-1210 Wien M +43 664 88657566 E roland.asm...@adesso.at W www.adesso.at - >>> business. people. technology. <<< - - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org