java - maven multi-module artifact deployment -


i have multi-module maven project parent builds modules , child pom aggregators handle config file deployments.

i able deploy bundles via mvn clean deploy parent module; however, fails attach config-files specified in build-helper plugin section of child module.

this requires me run mvn -f <child-module> clean deploy each child pom has configuration artifacts. true artifacts such features.

here example of pom files like:

parent

<project>     <groupid>com.sample</groupid>     <artifactid>parent</artifactid>     <version>1.0-snapshot</version>      <modules>         <module>child</module>     </modules> </project> 

child

<project>     <parent>         <groupid>com.sample</groupid>         <artifactid>parent</artifactid>         <version>1.0-snapshot</version>     </parent>      <artifactid>child</artifactid>      <build>         <plugins>             <plugin>                 <groupid>org.codehaus.mojo</groupid>                 <artifactid>build-helper-maven-plugin</artifactid>                 <executions>                     <execution>                         <id>attach-config-file</id>                         <phase>install</phase>                         <goals>                             <goal>attach-artifact</goal>                         </goals>                         <configuration>                             <runonlyatexecutionroot>true</runonlyatexecutionroot>                             <artifacts>                                 <artifact>                                     <file>properties.cfg</file>                                     <type>cfg</type>                                     <classifier>properties</classifier>                                 </artifact>                             </artifacts>                         </configuration>                     </execution>                 </executions>             </plugin>         </plugins>     </build> </project> 

what attach-artifact goal executed on each child module without having write custom batch script execute these individually. deploying archiva repository.

edit

parent build output (target server redacted):

c:\temp>mvn clean deploy -dskiptests [info] scanning projects... [info] ------------------------------------------------------------------------ [info] reactor build order: [info] [info] parent [info] child [info] features [info] [info] ------------------------------------------------------------------------ [info] building parent 1.0-snapshot [info] ------------------------------------------------------------------------ [info] [info] --- maven-clean-plugin:2.5:clean (default-clean) @ parent --- [info] [info] --- maven-install-plugin:2.4:install (default-install) @ parent --- [info] installing c:\temp\pom.xml c:\users\u14053\.m2\repository\com\sample\parent\1.0-snapshot\parent-1.0-snapshot.pom [info] [info] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ parent --- downloading: http://<server>/archiva/repository/snapshots/com/sample/parent/1.0-snapshot/maven-metadata.xml downloaded: http://<server>/archiva/repository/snapshots/com/sample/parent/1.0-snapshot/maven-metadata.xml (589 b @ 7.4 kb/sec)  uploading: http://<server>/archiva/repository/snapshots/com/sample/parent/1.0-snapshot/parent-1.0-20150511.162118-2.pom uploaded: http://<server>/archiva/repository/snapshots/com/sample/parent/1.0-snapshot/parent-1.0-20150511.162118-2.pom (4 kb @ 31.6 kb/sec) downloading: http://<server>/archiva/repository/snapshots/com/sample/parent/maven-metadata.xml downloaded: http://<server>/archiva/repository/snapshots/com/sample/parent/maven-metadata.xml (274 b @ 5.4 kb/sec) uploading: http://<server>/archiva/repository/snapshots/com/sample/parent/1.0-snapshot/maven-metadata.xml uploaded: http://<server>/archiva/repository/snapshots/com/sample/parent/1.0-snapshot/maven-metadata.xml (589 b @ 2.6 kb/sec) uploading: http://<server>/archiva/repository/snapshots/com/sample/parent/maven-metadata.xml uploaded: http://<server>/archiva/repository/snapshots/com/sample/parent/maven-metadata.xml (274 b @ 2.5 kb/sec) [info] [info] ------------------------------------------------------------------------ [info] building child 1.0-snapshot [info] ------------------------------------------------------------------------ [info] [info] --- maven-clean-plugin:2.5:clean (default-clean) @ child --- [info] deleting c:\temp\child\target [info] [info] --- maven-resources-plugin:2.4.3:resources (filter) @ child --- [info] using '1.6' encoding copy filtered resources. [info] copying 1 resource [info] [info] --- maven-resources-plugin:2.4.3:resources (default-resources) @ child --- [info] using '1.6' encoding copy filtered resources. [info] copying 1 resource [info] [info] --- maven-compiler-plugin:3.1:compile (default-compile) @ child --- [info] nothing compile - classes date [info] [info] --- maven-resources-plugin:2.4.3:testresources (default-testresources) @ child --- [info] using '1.6' encoding copy filtered resources. [info] skip non existing resourcedirectory c:\temp\child\src\test\resources [info] [info] --- maven-compiler-plugin:3.1:testcompile (default-testcompile) @ child --- [info] nothing compile - classes date [info] [info] --- maven-surefire-plugin:2.12.4:test (default-test) @ child --- [info] tests skipped. [info] [info] --- maven-jar-plugin:2.4:jar (default-jar) @ child --- [info] building jar: c:\temp\child\target\child-1.0-snapshot.jar [info] [info] --- maven-install-plugin:2.4:install (default-install) @ child --- [info] installing c:\temp\child\target\child-1.0-snapshot.jar c:\users\u14053\.m2\repository\com\sample\child\1.0-snapshot\child-1.0-snap shot.jar [info] installing c:\temp\child\pom.xml c:\users\u14053\.m2\repository\com\sample\child\1.0-snapshot\child-1.0-snapshot.pom [info] [info] --- build-helper-maven-plugin:1.8:attach-artifact (attach-config-file) @ child --- [info] skip attaching artifacts in project because it's not execution root [info] [info] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ child --- downloading: http://<server>/archiva/repository/snapshots/com/sample/child/1.0-snapshot/maven-metadata.xml downloaded: http://<server>/archiva/repository/snapshots/com/sample/child/1.0-snapshot/maven-metadata.xml (759 b @ 30.9 kb/sec)  uploading: http://<server>/archiva/repository/snapshots/com/sample/child/1.0-snapshot/child-1.0-20150511.162120-2.jar uploaded: http://<server>/archiva/repository/snapshots/com/sample/child/1.0-snapshot/child-1.0-20150511.162120-2.jar (2 kb @ 21 .1 kb/sec) uploading: http://<server>/archiva/repository/snapshots/com/sample/child/1.0-snapshot/child-1.0-20150511.162120-2.pom uploaded: http://<server>/archiva/repository/snapshots/com/sample/child/1.0-snapshot/child-1.0-20150511.162120-2.pom (2 kb @ 6. 1 kb/sec) downloading: http://<server>/archiva/repository/snapshots/com/sample/child/maven-metadata.xml downloaded: http://<server>/archiva/repository/snapshots/com/sample/child/maven-metadata.xml (273 b @ 9.2 kb/sec) uploading: http://<server>/archiva/repository/snapshots/com/sample/child/1.0-snapshot/maven-metadata.xml uploaded: http://<server>/archiva/repository/snapshots/com/sample/child/1.0-snapshot/maven-metadata.xml (759 b @ 33.7 kb/sec) uploading: http://<server>/archiva/repository/snapshots/com/sample/child/maven-metadata.xml uploaded: http://<server>/archiva/repository/snapshots/com/sample/child/maven-metadata.xml (273 b @ 10.7 kb/sec) [info] [info] ------------------------------------------------------------------------ [info] building features 1.0-snapshot [info] ------------------------------------------------------------------------ [info] [info] --- maven-clean-plugin:2.5:clean (default-clean) @ features --- [info] deleting c:\temp\features\target [info] [info] --- maven-resources-plugin:2.4.3:resources (filter) @ features --- [info] using '1.6' encoding copy filtered resources. [info] copying 0 resource [info] [info] --- maven-resources-plugin:2.4.3:resources (default-resources) @ features --- [info] using '1.6' encoding copy filtered resources. [info] copying 0 resource [info] [info] --- maven-compiler-plugin:3.1:compile (default-compile) @ features --- [info] nothing compile - classes date [info] [info] --- maven-resources-plugin:2.4.3:testresources (default-testresources) @ features --- [info] using '1.6' encoding copy filtered resources. [info] skip non existing resourcedirectory c:\temp\features\src\test\resources [info] [info] --- maven-compiler-plugin:3.1:testcompile (default-testcompile) @ features --- [info] nothing compile - classes date [info] [info] --- maven-surefire-plugin:2.12.4:test (default-test) @ features --- [info] tests skipped. [info] [info] --- maven-jar-plugin:2.4:jar (default-jar) @ features --- [info] building jar: c:\temp\features\target\features-1.0-snapshot.jar [info] [info] --- maven-install-plugin:2.4:install (default-install) @ features --- [info] installing c:\temp\features\target\features-1.0-snapshot.jar c:\users\u14053\.m2\repository\com\sample\features\1.0-snapshot\featu res-1.0-snapshot.jar [info] installing c:\temp\features\pom.xml c:\users\u14053\.m2\repository\com\sample\features\1.0-snapshot\features-1.0-snapshot.pom [info] [info] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ features --- downloading: http://<server>/archiva/repository/snapshots/com/sample/features/1.0-snapshot/maven-metadata.xml downloaded: http://<server>/archiva/repository/snapshots/com/sample/features/1.0-snapshot/maven-metadata.xml (762 b @ 27.6 kb/s ec) uploading: http://<server>/archiva/repository/snapshots/com/sample/features/1.0-snapshot/features-1.0-20150511.162120-2.jar uploaded: http://<server>/archiva/repository/snapshots/com/sample/features/1.0-snapshot/features-1.0-20150511.162120-2.jar (2 kb  @ 24.0 kb/sec) uploading: http://<server>/archiva/repository/snapshots/com/sample/features/1.0-snapshot/features-1.0-20150511.162120-2.pom uploaded: http://<server>/archiva/repository/snapshots/com/sample/features/1.0-snapshot/features-1.0-20150511.162120-2.pom (2 kb  @ 7.9 kb/sec) downloading: http://<server>/archiva/repository/snapshots/com/sample/features/maven-metadata.xml downloaded: http://<server>/archiva/repository/snapshots/com/sample/features/maven-metadata.xml (276 b @ 5.1 kb/sec) uploading: http://<server>/archiva/repository/snapshots/com/sample/features/1.0-snapshot/maven-metadata.xml uploaded: http://<server>/archiva/repository/snapshots/com/sample/features/1.0-snapshot/maven-metadata.xml (762 b @ 7.4 kb/sec)  uploading: http://<server>/archiva/repository/snapshots/com/sample/features/maven-metadata.xml uploaded: http://<server>/archiva/repository/snapshots/com/sample/features/maven-metadata.xml (276 b @ 12.8 kb/sec) [info] ------------------------------------------------------------------------ [info] reactor summary: [info] [info] parent ............................................. success [  1.011 s] [info] child .............................................. success [  1.183 s] [info] features ........................................... success [  0.563 s] [info] ------------------------------------------------------------------------ [info] build success [info] ------------------------------------------------------------------------ [info] total time: 2.853 s [info] finished at: 2015-05-11t12:21:21-04:00 [info] final memory: 11m/244m [info] ------------------------------------------------------------------------ 

remove or change false runonlyatexecutionroot property.

if set true then: "this cause execution run @ top of given module tree. is, run in project contained in same folder mvn execution launched."

probably not finding cfgs files.


Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Add class to another page attribute using URL id - Jquery -