[ http://jira.codehaus.org/browse/MNG-4960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=250676#action_250676 ]
Sujit Kabbinahally commented on MNG-4960: ----------------------------------------- Benjamin - I've created a sample project depicting the multi-module enterprise project (has multiple ear modules) as it pertains to our setup (File: MNG-4960_SK.zip). Hope this helps. Now note the difference when you call the command in Maven2 (2.2.1) and Maven3 (3.0.1). mvn -pl ear-1 -am -rf sub-1 clean package In Maven3, when 'resume from' option is used, the end project pointed by '-pl' option is ignored and not loaded into the list of dependent sub-projects Maven is supposed to build (please see the Reactor build order). I'm not sure if this was intentional in Maven3. The same in Maven2 works. However, if you were to not use '-rf' option the reactor loads all projects including the end project i.e. call: mvn -pl ear-1 clean package. And of course you can try with any other combination of '-rf' and see the same behavior i.e. mvn -pl ear-2 -am -rf sub-3 clean package or mvn -pl ear-1 -am -rf sub-2 clean package, and so on. Please let me know should you need more info. Thanks, SK > Maven3 behaves differently than Maven2 when building a multi-module > enterprise project on command line > ------------------------------------------------------------------------------------------------------ > > Key: MNG-4960 > URL: http://jira.codehaus.org/browse/MNG-4960 > Project: Maven 2 & 3 > Issue Type: Bug > Components: Command Line > Affects Versions: 3.0, 3.0.1 > Environment: Apache Maven 3.0.1 (r1038046; 2010-11-23 02:58:32-0800) > Java version: 1.6.0_19 > OS name: Windows XP/Vista > Reporter: Sujit Kabbinahally > Attachments: Maven3 Command Line.zip, Maven3 Command Line.zip, > MNG-4960.zip, MNG-4960_SK.zip > > > As of now in Maven2 (2.2.1) we are able to build a multi-module enterprise > project as explained below and the same does not work in Maven3 (3.0.1) after > the migration. > Basically in the multi-module enterprise project, we build multiple ear's > with their own dependents and each one of these EAR's is built as its own > module by inheriting properties/attributes etc from the parent pom at the > base level of the whole project. > In Maven2, the below command to accomplish the above explanation works as > expected when initiated from the ${project.basedir} of the main project. > mvn -pl ear_module -am -rf first_dependent_module clean install -P <profileId> > @ build time, the reactor lists the build order as shown below > 1. first_dependent_module > 2. second_dependent_module > 3. ear_module > Option '-rf' is used to NOT delete the target folder at the main > ${project.basedir} since we want to still keep the output from the build of > another EAR and its dependents. > With Maven3, however, the reactor lists the build order as shown below: > 1. first_dependent_module > 2. second_dependent_module > Maven3 ignores the argument (ear_module) set to '-pl' option to be also built > after its dependents have been. > > This behavior can be made to work only if '-rf' option is removed from the > command and i.e. call 'mvn -pl ear_module -am clean install -P <profileId>' > which defeats the whole purpose of NOT deleting the 'target' folder under > under base ${project.basedir}. > Attached doc has screen shots to display the behavior explained above for all > cases. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira