简体   繁体   English

用本地库覆盖Maven依赖

[英]override maven dependency with local library

In my pom.xml I want to include 我想在pom.xml中包含

<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-rest-webmvc</artifactId>
    <version>2.2.1.RELEASE</version>
</dependency>

Unfortunately this library is not being pulled because it depends on: 不幸的是,该库没有被拉出,因为它取决于:

-> spring-data-rest-core 2.2.1
-> org.atteo.evo-inflector 1.2
-> org.atteo.parent 1.10

The last one (org.atteo.parent) has an issue fixed in 1.11 (@see: https://github.com/atteo/parent/commit/8f8db3004cb89d61b22e8348dcc4935a051b5529 ). 最后一个(org.atteo.parent)在1.11中已解决问题(@see: https : //github.com/atteo/parent/commit/8f8db3004cb89d61b22e8348dcc4935a051b5529 )。

What is the best way around this issue? 解决此问题的最佳方法是什么? I already tried to hack a little around (this means manually adding the org.atteo.parent dependency to the pom in a newer version, but this is neither elegant nor does it work). 我已经尝试了一些技巧(这意味着在较新的版本中手动将org.atteo.parent依赖项添加到pom中,但这既不美观也不起作用)。

It seems you want to remove the "org.atteo.parent" from the dependencies, is that right? 看来您想从依赖项中删除“ org.atteo.parent”,对吗? If that's the case, try this: 如果是这种情况,请尝试以下操作:

<dependency>
  ...
  <exclusions>
    <exclusion>
      <groupId>org.atteo.parent</groupId>
      <artifactId>1.10</artifactId>
    </exclusion>
  </exclusions> 
</dependency>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM