how to use Maven Assembly plugin in Multimodule Projects
I have a multimodule maven project 开发者_如何学Clike :
Main Module
Module A
Module B
Module C
when i build the Main module it will produce the following:
Main Module
Module A
target/A.jar
Module B
target/B.jar
Module C
target/C.jar
i need an assembly descriptor to zip all child artifacts (A.jar, B.jar, C.jar here) in a file :
My.zip
- A.jar
- B.jar
- C.jar
any idea ? Thanks in advance.
You could try something like this... Refer to this link for details.
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>distribution</id>
<formats>
<format>zip</format>
</formats>
<moduleSets>
[...]
<moduleSet>
<includes>
<include>${project.groupId}:A</include>
<include>${project.groupId}:B</include>
<include>${project.groupId}:C</include>
</includes>
</moduleSet>
</moduleSets>
[...]
</assembly>
精彩评论