我正在收集分隔符文件夹中的所有依赖库,mvn package如下所示:
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven.copy.plugin}</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
问题:这也包括<scope>test</scope>库.我该如何排除这些库?
man*_*uti 21
使用a includeScope仅包含runtime范围依赖项:
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven.copy.plugin}</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib/</outputDirectory>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
显然,<excludeScope>test</excludeScope>似乎不支持,因为test范围涵盖所有依赖项(https://issues.apache.org/jira/browse/MDEP-85).
| 归档时间: |
|
| 查看次数: |
4574 次 |
| 最近记录: |