SpringBoot整合Nacos,OpenFeign,Dubbo遇到的依赖问题
首先确定SpringBoot版本,可参考SpringCloudAlibaba。
如果要引入SpringCloud相关组件,版本号要和SpringCloud一致,这样可以避免相当多莫名其妙的问题。
放一份可用的依赖版本
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<spring-boot.version>2.6.11</spring-boot.version>
<spring-cloud.version>2021.0.4</spring-cloud.version>
<spring-cloud-alibaba.version>2021.0.4.0</spring-cloud-alibaba.version>
<mybatis-plus.version>3.5.3.1</mybatis-plus.version>
<weixin-java-cp.version>4.4.0</weixin-java-cp.version>
<weixin-java-mp.version>4.4.0</weixin-java-mp.version>
<apache-commons-text.version>1.10.0</apache-commons-text.version>
<apache-commons-collections4.version>4.4</apache-commons-collections4.version>
<hutool-all.version>5.8.11</hutool-all.version>
<springdoc.version>1.6.14</springdoc.version>
</properties>
<dependencies>
<!-- YML提示 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<!-- SpringCloud Alibaba -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>${spring-cloud-alibaba.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- SpringCloud -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- SpringBoot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
如有错漏,欢迎指正!谢绝转载。