父项目 pom.xml
<?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>org.hxm</groupId> <artifactId>spring-cloud</artifactId> <packaging>pom</packaging> <version>1.0-SNAPSHOT</version> <modules> <module>spring-eureka</module> <module>order-Server</module> <module>ribbon-server</module> <module>fegin-client</module> <module>fegin-client</module> </modules> <name>spring-cloud</name> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.3.RELEASE</version> <relativePath/> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> <spring-cloud.version>Finchley.RELEASE</spring-cloud.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>${spring-cloud.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project>
注意:spring boot的版本和Springcluod版本需要对应,否则会出现错误,否则会出现
- java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava/lang/Object;)V 这个错误
SpringCloud | SpringBoot |
Finchley | 兼容Spring Boot 2.0.x,不兼容Spring Boot 1.5.x |
Dalston和Edgware | 兼容Spring Boot 1.5.x,不兼容Spring Boot 2.0.x |
Camden | 兼容Spring Boot 1.4.x,也兼容Spring Boot 1.5.x |
Brixton | 兼容Spring Boot 1.3.x,也兼容Spring Boot 1.4.x |
Angel | 兼容Spring Boot 1.2.x |
原文地址:https://www.cnblogs.com/JavaHxm/p/11408432.html
时间: 2024-11-07 23:39:39