Spring boot 在STS中启动Spring云配置服务器时引发NoniqueBeandDefinitionException
我有一个Spring Cloud配置服务器,启动应用程序,具有以下pom:Spring boot 在STS中启动Spring云配置服务器时引发NoniqueBeandDefinitionException,spring-boot,Spring Boot,我有一个Spring Cloud配置服务器,启动应用程序,具有以下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:
<?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.example</groupId>
<artifactId>scc-server</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>scc-server</name>
<description>Spring Cloud (Centralized) Config. Server</description>
<parent>
<groupId>my.company</groupId>
<artifactId>company_parent</artifactId>
<version>1.0</version>
</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>Brixton.RELEASE</spring-cloud.version>
<org.springframework.boot.version>1.3.6.RELEASE</org.springframework.boot.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-monitor</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
</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>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${org.springframework.boot.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>
当我通过命令行运行同一个项目时(mvn-spring-boot:run),它会启动并正常运行
运行时不会引发异常:
<spring-cloud.version>Brixton.SR7</spring-cloud.version>
<org.springframework.boot.version>1.3.8.RELEASE</org.springframework.boot.version>
Brixton.SR7
1.3.8.1发布
我们使用的是SpringBootVersion1.3.6.RELEASE,因此无法更改。非常感谢您的帮助
<spring-cloud.version>Brixton.SR7</spring-cloud.version>
<org.springframework.boot.version>1.3.8.RELEASE</org.springframework.boot.version>