更新时间:2022-01-04 03:19:24
尝试创建自定义程序集描述符并添加dependencySet,并确保指定,解包为false。
Try creating a custom assembly descriptor and add a dependencySet and make sure you specify, unpack as false.
将此作为汇编描述符使用,
Use this as assembly descriptor,
<?xml version="1.0" encoding="UTF-8"?>
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>distribution</id>
<formats>
<format>zip</format>
</formats>
<dependencySets>
<dependencySet>
<scope>runtime</scope>
<outputDirectory>lib</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
<unpack>false</unpack>
</dependencySet>
</dependencySets>
</assembly>
将此文件存储为src / main / assembly / assembly.xml并更新汇编插件配置像这样的pom.xml。
Store this file to say src/main/assembly/assembly.xml and update your assembly plugin configuration in pom.xml like this.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>assembly</id>
<phase>package</phase>
<goals>
<goal>attached</goal>
</goals>
<configuration>
<descriptor>${basedir}/src/main/assembly/assembly.xml</descriptor>
</configuration>
</execution>
</executions>
</plugin>
如果您还需要更多内容,这是汇编描述符引用
Here is assembly descriptor reference if you need anything more
http://maven.apache.org/plugins/maven -assembly-plugin / assembly.html