我的是springboot多模块
父模块中引入了mybatis-plus的版本 不知道为什么在 mvn dependency:tree 时报错了
说是子模块没有设定mybatis-plus的版本 后再子模块加入版本号后不报错了,项目也可以正常启动了。
有懂的大神给看看什么问题
父pom
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.zjf</groupId> <artifactId>springCloudAlibaba</artifactId> <packaging>pom</packaging> <version>1.0-SNAPSHOT</version> <modules> <module>cloud-service</module> <module>user-server</module> </modules> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.6.13</version> <relativePath/> </parent> <properties> <java.version>1.8</java.version> <!-- 编译时的编码 --> <maven.compiler.encoding>UTF-8</maven.compiler.encoding> <!-- 文件拷贝时的编码 --> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <spring-boot.version>2.6.13</spring-boot.version> <mybatis-plus.version>3.5.1</mybatis-plus.version> </properties> <!-- 全局引入下载依赖地址,并不会引入依赖 --> <dependencyManagement> <dependencies> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>${mybatis-plus.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> </project>
子pom
<dependency>标签:27,missing,pom,boot,version,plus,mybatis,com,starter From: https://www.cnblogs.com/zjf6666/p/18563919
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>