0
我有一個包含2個子模塊的父項目。我想創建一個只包含項目和相關jar的包。我面臨的問題是所有源文件[java,腳本,配置]也包含在神器中,有人可以幫助如何實現這一點。 以下是我使用的描述:只有項目和從屬jar的Maven組件包
<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>binaries</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<moduleSets>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>*:sub1</include>
<include>*:sub2</include>
</includes>
<binaries>
<outputDirectory>${artifactId}</outputDirectory>
<unpack>true</unpack>
<unpackOptions>
<excludes>
<exclude>**/resources/**</exclude>
<exclude>**/docs/**</exclude>
<exclude>**/src/**</exclude>
</excludes>
</unpackOptions>
<dependencySets>
<dependencySet>
<outputDirectory>${artifactId}/lib</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<unpack>false</unpack>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</binaries>
</moduleSet>
</moduleSets>
</assembly>
Thanks.Your描述符做的工作。 – Lokesh