Java 如何匹配Maven发布版本

Java 如何匹配Maven发布版本,java,spring,maven,Java,Spring,Maven,我有一个maven项目,我刚刚更改了我的spring-data-neo4j依赖版本 它有: <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-commons</artifactId> <version>1.12.0.RELEASE</version>

我有一个maven项目,我刚刚更改了我的
spring-data-neo4j
依赖版本

它有:

    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-commons</artifactId>
        <version>1.12.0.RELEASE</version>
    </dependency>
这是因为(我认为)我的两个依赖项具有相同的
groupId
,但不是从相同版本的组中提取的

问题

如何知道应使用哪个版本的
spring-data-commons
来匹配
spring-data-neo4j
的5.0.0版本

更新


我修复了我的问题,尝试了很多版本,直到错误消失。这并不是一个真正的答案,但我的问题现在已经解决了。

问题在于在pom.xml中将spring data commons 1.12.0.RELEASE单独定义为一个依赖项

仅定义spring-data-neo4j 5.0.0.RELEASE将通过传递方式获得所属版本的spring data commons,即2.0.0.RELEASE,但如果您还单独定义较旧的spring data commons 1.12.0.RELEASE,则它将覆盖较新的传递依赖性版本,并将导致出现问题;可能是因为较新版本的neo4j将尝试使用SpringDataCommonsAPI,该API在版本1.12.0.RELEASE和版本2.0.0.RELEASE之间进行了更改

[INFO] +- org.springframework.data:spring-data-commons:jar:1.12.0.RELEASE:compile
[INFO] +- org.springframework.data:spring-data-neo4j:jar:5.0.0.RELEASE:compile
          (...no transitive spring-data-commons:jar here)
请参阅
mvn依赖项:树的相关部分

仅定义spring-data-neo4j 5.0.0.0版本

[INFO] +- org.springframework.data:spring-data-neo4j:jar:5.0.0.RELEASE:compile
[INFO]    +- org.springframework.data:spring-data-commons:jar:2.0.0.RELEASE:compile
定义spring-data-neo4j 5.0.0.RELEASE和spring数据共享1.12.0.RELEASE

[INFO] +- org.springframework.data:spring-data-commons:jar:1.12.0.RELEASE:compile
[INFO] +- org.springframework.data:spring-data-neo4j:jar:5.0.0.RELEASE:compile
          (...no transitive spring-data-commons:jar here)

请进一步编辑您的更新或为未来读者提供答案,本网站的目标不是解决您的问题,而是让未来有类似问题的读者也能解决。如果发现这个问题,没有人知道如何解决这个问题
[INFO] +- org.springframework.data:spring-data-neo4j:jar:5.0.0.RELEASE:compile
[INFO]    +- org.springframework.data:spring-data-commons:jar:2.0.0.RELEASE:compile
[INFO] +- org.springframework.data:spring-data-commons:jar:1.12.0.RELEASE:compile
[INFO] +- org.springframework.data:spring-data-neo4j:jar:5.0.0.RELEASE:compile
          (...no transitive spring-data-commons:jar here)