java - run maven plugin goal on multiple modules -
so have many maven modules in project , i'd run 1 maven plugin's goal on multiple modules
here's do:
mvn -pl module1,module2,module3 wls:deploy
unfortunately here's get:
[info] ------------------------------------------------------------------------ [info] reactor summary: [info] [info] module1 ............................................... success [7.422s] [info] module2 ............................................... skipped [info] module3 ............................................... skipped [info] ------------------------------------------------------------------------ [info] build success [info] ------------------------------------------------------------------------ [info] total time: 8.370s [info] finished at: thu jul 02 09:34:37 cest 2015 [info] final memory: 23m/301m [info] ------------------------------------------------------------------------
so problem maven skips modules after first one, , i'd goal fired on modules.
this i'd achieve:
[info] ------------------------------------------------------------------------ [info] reactor summary: [info] [info] module1 ............................................... success [7.422s] [info] module2 ............................................... success [12.674s] [info] module3 ............................................... success [4.563s] [info] ------------------------------------------------------------------------ [info] build success [info] ------------------------------------------------------------------------ [info] total time: 8.370s [info] finished at: thu jul 02 09:34:37 cest 2015 [info] final memory: 23m/301m [info] ------------------------------------------------------------------------
the plugin use is:
<groupid>com.oracle.weblogic</groupid> <artifactid>wls-maven-plugin</artifactid> <version>12.1.1.0</version>
how make maven run goal on both modules?
use maven submodule functionality, example internet weather , webapp modules
<project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelversion>4.0.0</modelversion> <groupid>org.sonatype.mavenbook.multi</groupid> <artifactid>simple-parent</artifactid> <packaging>pom</packaging> <version>1.0</version> <name>multi chapter simple parent project</name> <modules> <module>simple-weather</module> <module>simple-webapp</module> </modules> <build> <pluginmanagement> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> </plugins> </pluginmanagement> </build> <profiles> <profile> <id>ci</id> <modules> <module>simple-weather</module> <module>simple-webapp</module> </modules> </profile> </profiles> <dependencies> <dependency> <groupid>junit</groupid> <artifactid>junit</artifactid> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> </project>
then mvn -pl simple-parent wls:deploy
Comments
Post a Comment