如何使用maven在完成组装目标后重新打包到jar?
我需要将多个jar的内容重新打包到一个jar文件中,以便将jar解包到assembly dir。这是通过一个非常标准的程序集描述符完成的:如何使用maven在完成组装目标后重新打包到jar?,maven,maven-assembly-plugin,Maven,Maven Assembly Plugin,我需要将多个jar的内容重新打包到一个jar文件中,以便将jar解包到assembly dir。这是通过一个非常标准的程序集描述符完成的: <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.a
<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>
问题是,我如何将整个东西打包到一个罐子里?我是否需要创建一个新的POM来重新打包程序集的输出
谢谢您可以添加到您的程序集描述符中
<format>jar</format>
您可以添加到程序集描述符中
<format>jar</format>
发现我可以使用maven jar插件。但是我仍然不太了解它。我发现我可以使用maven jar插件。但还是不太了解。