Parent pom code
<modelVersion>4.0.0</modelVersion> <groupId>com.example</groupId> <artifactId>SpringCloudDemo</artifactId> <version>0.0.1-SNAPSHOT</version> <name>SpringCloudDemo</name> <description>SpringCloudDemo</description> <packaging>pom</packaging> <dependencyManagement> <dependencies> <dependency> <groupId>org.apache.dubbo</groupId> <artifactId>dubbo-spring-boot-starter</artifactId> <version>${spring-boot-dubbo.version}</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>org.apache.dubbo</groupId> <artifactId>dubbo</artifactId> <version>${spring-boot-dubbo.version}</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>org.apache.dubbo</groupId> <artifactId>dubbo-registry-nacos</artifactId> <version>${spring-boot-dubbo-nacos.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>in child pom ,child extends parent pom In Child POM
<parent>
<groupId>com.example</groupId>
<artifactId>SpringCloudDemo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
</dependency>
<!-- Nacos依赖 -->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-registry-nacos</artifactId>
<version>3.0.1</version>
</dependency>
</dependencies>
- But my child pom download 2.7.4.1 version,no use Parent Pom 3.1.9 Version dubbo,like picture
- I have one questions:
I want use 3.1.9 Version Dubbo ,But In Child Pom download 2.7.4.1 Version Dubbo?what happening?
Perhaps the problem could be in defining dependencies in the
<dependentManagement/>section in the parentpom. For example:The
<type/>and</scope>are incorrect, beacuse thedubbo-spring-boot-starterdependency isn't of typepomand you didn't should to define the scope asimport.According to official docs, the
importscope is only relevant for depepndencies with typepom:Try to remove the type and scope from all dependencies in the
<dependentManagement/>section in the parentpom.It is just a guess.