【问题标题】:How to explicitly exclude something from the jar如何从 jar 中明确排除某些内容
【发布时间】:2013-12-10 19:16:07
【问题描述】:

我有一个使用 maven 构建的 Web 应用程序。

在我的 pom 中,如果我需要的 xyz.jar 包含它,我如何在构建时明确排除 abc.jar?

【问题讨论】:

  • 咳咳……为什么要投反对票?

标签: java maven pom.xml


【解决方案1】:

取自:

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>

【讨论】:

    猜你喜欢
    • 2016-07-05
    • 2017-03-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-01
    • 1970-01-01
    • 2020-04-20
    相关资源
    最近更新 更多