当依赖项直接包含在 pom 文件中时,我的程序集描述符会正确应用包含和排除。
但是,当我将依赖项放在父 pom 文件中时,程序集:目录目标报告包含和排除尚未触发。
你知道为什么 maven-assembly-plugin 会忽略父依赖吗?我该如何解决?
以下是 Maven 和程序集描述符:
装配描述符:
<assembly>
<id>distribution</id>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<includes>
<include>readme.txt</include>
</includes>
</fileSet>
<fileSet>
<directory>target</directory>
<outputDirectory>/lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<outputDirectory>/lib</outputDirectory>
<unpack>false</unpack>
<scope>runtime</scope>
<excludes>
<exclude>org.tanukisoftware:wrapper:exe:3.3.5</exclude>
</excludes>
</dependencySet>
<dependencySet>
<outputDirectory>/bin</outputDirectory>
<unpack>false</unpack>
<scope>runtime</scope>
<includes>
<include>org.tanukisoftware:wrapper:exe:3.3.5</include>
</includes>
</dependencySet>
</dependencySets>
</assembly>
子 POM 程序集插件定义:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>directory</goal>
</goals>
</execution>
</executions>
</plugin>
父 POM 依赖项:
<dependencies>
<dependency>
<groupId>org.tanukisoftware</groupId>
<artifactId>wrapper</artifactId>
<version>3.3.5</version>
<type>dll</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.tanukisoftware</groupId>
<artifactId>wrapper</artifactId>
<version>3.3.5</version>
<type>exe</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.tanukisoftware</groupId>
<artifactId>wrapper</artifactId>
<version>3.3.5</version>
<scope>runtime</scope>
</dependency>
</dependencies>
构建报告中的警告:
[assembly:directory {execution: make-assembly}]
Reading assembly descriptor: assembly.xml
Processing DependencySet (output=/lib)
[WARNING] The following patterns were never triggered in this artifact exclusion filter:
o 'org.tanukisoftware:wrapper:exe:3.3.5'
Processing DependencySet (output=/bin)
[WARNING] The following patterns were never triggered in this artifact inclusion filter:
o 'org.tanukisoftware:wrapper:exe:3.3.5'