maven cannot use correct version in verson range

Viewed 2763

I'm using maven version 3.6.2 to build my project, it has multiple layers of dependencies and finally depends on ~/.m2/repository/com/nimbusds/nimbus-jose-jwt/5.10/nimbus-jose-jwt-5.10.pom

<dependency>
            <groupId>net.minidev</groupId>
            <artifactId>json-smart</artifactId>
            <version>[1.3.1,2.3]</version>
</dependency>

I got compile failed: com.nimbusds:nimbus-jose-jwt:jar:5.10 -> net.minidev:json-smart:jar:2.3-SNAPSHOT: Failed to read artifact descriptor for net.minidev:json-smart:jar:2.3-SNAPSHOT: Failure to find net.minidev:minidev-parent:pom:2.3-SNAPSHOT... If I manually update ~/.m2/repository/com/nimbusds/nimbus-jose-jwt/5.10/nimbus-jose-jwt-5.10.pom to use <version>2.3</version> instead of <version>[1.3.1,2.3]</version>then it can compile fine. Why maven cannot interpret [1.3.1,2.3] correctly?

1 Answers

I use this to solve the program, refer https://bitbucket.org/connect2id/nimbus-jose-jwt/issues/388/json-smart-pom-23-snapshot

<dependency>
  <groupId>com.nimbusds</groupId>
  <artifactId>nimbus-jose-jwt</artifactId>
  <version>5.10</version>
  <!--参考https://bitbucket.org/connect2id/nimbus-jose-jwt/issues/388/json-smart-pom-23-snapshot-->
  <exclusions>
    <exclusion>
      <groupId>net.minidev</groupId>
      <artifactId>json-smart</artifactId>
    </exclusion>
  </exclusions>
</dependency>

<dependency>
  <groupId>net.minidev</groupId>
  <artifactId>json-smart</artifactId>
  <version>2.3</version>
</dependency>
Related