How to limit the version of a third-party package dependency link?

I have a third party dependency in my project that references its dependencies using an open source link:

<version>[4.0,)</version>

How can I override this in my project so that my dependency does not use versions of its dependency later than the specific version 6.0? (versions of later versions 6.0 require some other packages that I don't want at all)

+3
source share
1 answer

If you specify a transitive dependency explicitly in your project, the version you specify will take precedence.

. POM com.foo:bar , :

<dependencies>
  <dependency>
    <groupId>com.foo</groupId>
    <artifactId>bar</artifactId>
    <version>[4.0,6.0)</version>
  </dependency>
</dependencies>

Update (2): , ( ). .

3 : , -. , -. 3 , 0.0.1, 1.0.1 2.0.1 : :

name.seller.rich:test-base:jar:0.0.1
\- name.seller.rich:test-dependency:jar:0.0.1:compile
   \- name.seller.rich:test-transitive:jar:2.0.1:compile

- , [0.0.1.2.0.0], :

name.seller.rich:test-base:jar:0.0.1
+- name.seller.rich:test-dependency:jar:0.0.1:compile
\- name.seller.rich:test-transitive:jar:1.0.1:compile
+3

Source: https://habr.com/ru/post/1713799/


All Articles