maven-dependency-plugin:排除.jar文件 [英] maven-dependency-plugin: exclude .jar files
问题描述
我正在使用maven-dependency-plugin.我只需要下载一个ZIP文件,而排除所有jar文件.
I am using maven-dependency-plugin. I need to download only a ZIP file and exclude all jar files.
插件配置采用以下方式.
Plugin configuration looks the following way.
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<!-- <outputDirectory>${project.build.directory}</outputDirectory> -->
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<excludes>**/*.jar</excludes>
<includes>**/*.zip</includes>
</configuration>
</execution>
该插件仍会下载所有内容:所有jar.
The plugin still downloads everything: all jars.
推荐答案
maven-dependency-plugin 的="nofollow"> copy-dependencies
目标不支持 includes
和 excludes
属性.
The copy-dependencies
goal of the maven-dependency-plugin
does not support includes
and excludes
attributes.
但是,您可以使用 <代码> excludeTypes 属性以排除特定的依赖项类型.
逗号分隔的要排除的类型列表.空字符串表示不排除任何内容(默认).
Comma Separated list of Types to exclude. Empty String indicates don't exclude anything (default).
以下内容将排除所有 jar
依赖项:
The following will exclude all the jar
dependencies:
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<!-- <outputDirectory>${project.build.directory}</outputDirectory> -->
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<excludeTypes>jar</excludeTypes>
</configuration>
</execution>
这篇关于maven-dependency-plugin:排除.jar文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!