java - Run Maven goal for only one module in multi module project -
i have project has 4 modules. said, have parent project parent pom.xml specifying theses modules.
<modules> <module>module1-desktop</module> <module>module2-core</module> <module>module3-web</module> <module>module4-ear</module> </modules>
the module4-ear has module3-web , module2-core dependencies (not modules) , generates ear deployed jboss.
i want able build module4-ear, building module3-web , module2-core before it, up-to-date , deploy jboss. i'm running following maven command in parent project:
mvn --projects module2-core,module3-web,module4-ear clean install jboss:hard-undeploy jboss:hard-deploy
in parent pom i've set jboss-maven-plugin this:
<plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>jboss-maven-plugin</artifactid> <configuration> <skip>true</skip> </configuration> </plugin>
in module4-ear's pom.xml i've set jboss-maven-plugin way:
<plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>jboss-maven-plugin</artifactid> <configuration> <skip>false</skip> <jbosshome>${env.jboss_home}</jbosshome> <servername>default</servername> <unpack>true</unpack> <filenames> <filename>build/module4-ear.ear</filename> </filenames> </configuration> </plugin>
the problem want module4-ear.ear deployed server, module3-web.war , module2-core deployed well. want in single command, instead of running 2 mvn commands, 1 "clean install" projects , deploy ear. how can achieve that?
if want deploy ear add jboss-maven-plugin pom of module4-ear. plugin work within module. adding deployment plugins parent pom leads executing modules - not want.
you can chain commands mvn clean install plugin:goal
the plugin use seems superceded jboss as7 deployment plugin: http://docs.jboss.org/jbossas/7/plugins/maven/latest/ (as side note)
so mvn clean install jboss-as:deploy
you can add execution jboss plugin , bind deploy phase mvn clean deploy
copy artifact remote repository , deploy ear jboss.
an example using install phase at: http://docs.jboss.org/jbossas/7/plugins/maven/latest/examples/deployment-example.html
Comments
Post a Comment