【发布时间】:2013-12-10 19:16:07
【问题描述】:
我有一个使用 maven 构建的 Web 应用程序。
在我的 pom 中,如果我需要的 xyz.jar 包含它,我如何在构建时明确排除 abc.jar?
【问题讨论】:
-
咳咳……为什么要投反对票?
我有一个使用 maven 构建的 Web 应用程序。
在我的 pom 中,如果我需要的 xyz.jar 包含它,我如何在构建时明确排除 abc.jar?
【问题讨论】:
取自:
http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html
<dependency>
<groupId>sample.ProjectA</groupId>
<artifactId>Project-A</artifactId>
<version>1.0</version>
<scope>compile</scope>
<exclusions>
<exclusion> <!-- declare the exclusion here -->
<groupId>sample.ProjectB</groupId>
<artifactId>Project-B</artifactId>
</exclusion>
</exclusions>
</dependency>
【讨论】: