Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 为什么子依赖项的父覆盖版本_Spring Boot_Maven_Dependencies_Pom.xml - Fatal编程技术网

Spring boot 为什么子依赖项的父覆盖版本

Spring boot 为什么子依赖项的父覆盖版本,spring-boot,maven,dependencies,pom.xml,Spring Boot,Maven,Dependencies,Pom.xml,我有spring boot应用程序: <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.3.3.RELEASE</version> </parent> 如何从依赖项而不是从父项使用版本?这些版本在

我有spring boot应用程序:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.3.3.RELEASE</version>
</parent>

如何从依赖项而不是从父项使用版本?

这些版本在
spring boot dependencies
中设置,它是父项的父项

您需要覆盖这些属性

3.12.8
1.3.2
也许更多的取决于你想做什么

您不能忽略这些值而使用依赖项中的值。您需要显式地覆盖它

    <dependency>
        <groupId>cz.my</groupId>
        <artifactId>my-hazelcast-common</artifactId>
    </dependency>
[INFO] +- cz.my:my-hazelcast-common:jar:2.1-SNAPSHOT:compile
[INFO] |  \- com.hazelcast:hazelcast:jar:3.12.8:compile