具有相同maven模块的差异具有给定依赖性的不同版本

时间:2018-06-03 21:43:48

标签: java maven

用文字解释我的问题很难,所以我拍了一张照片,它显示了我的问题:

enter image description here

如您所见,我有3个相关模块,一个全球,一个genui和网站。

genui取决于全球和网络取决于genui。

直接来说,网络并不依赖于全球,但通过genui它显然也是如此。

正如你所看到的,如果我看一下hibernate版本的web-> genui-> global,它是5.2.14,但如果我从genui-> global看它,那就是5.3。 0

没有,除了1.0-SNAPSHOT之外,从未有过这些模块的任何版本。

我尝试清理,删除.m2 / repository中的文件,甚至尝试彻底清除本地仓库,没有任何效果。我不知道maven在哪里获得5.2.14号码,我不记得曾经把它放进去。版本是从父模块中的属性接收的。

我发现问题是由web模块的pom.xml引起的,更具体地说是这部分:

<dependencyManagement>
...
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
...
</dependencyManagement>

1 个答案:

答案 0 :(得分:1)

You probably need to exclude that repeated dependency from one of the spring ones... verify all your dependencies and look which are the ones that include hibernate. Check that you also have different versions for servlet-api.

相关问题