1
我需要重新打包到jar文件中的多個罐子的內容,所以我使用Maven assembly plugin將罐子拆包到程序集目錄。這是用一個非常標準的組裝描述符完成的:如何使用maven在裝配目標後重新打包爲jar?
<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>assembly</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
<unpack>true</unpack>
<unpackOptions>
<excludes>
<exclude>**/dll/**</exclude>
<exclude>**/dylib/**</exclude>
<exclude>**/so/**</exclude>
</excludes>
</unpackOptions>
<scope>runtime</scope>
<useTransitiveDependencies>false</useTransitiveDependencies>
<includes>
<include>com.corp*:*</include>
</includes>
<excludes>
<exclude>com.corp*:*-xb-*</exclude>
<exclude>com.corp*:juniper</exclude>
</excludes>
</dependencySet>
</dependencySets>
<files>
<file>
<source>about.txt</source>
<outputDirectory>/lib</outputDirectory>
<filtered>true</filtered>
</file>
</files>
</assembly>
問題是,我如何將整個東西打包到jar中?我是否需要創建一個新的POM來重新打包程序集的輸出?
感謝
發現我可以使用maven-JAR的插件。但還是不太瞭解。 – 2012-02-22 16:43:27