找不到org.springframework.boot.autoconfigure.security.SecurityProperties类

时间:2018-12-24 14:39:02

标签: spring microservices spring-cloud

我已经开发了 Spring Boot + Microservices 示例,并在此处加载:https://github.com/JavaHelper/spring-cloud-howtodoinjava/tree/master/msa。此示例用法为Spring Boot版本1.5.4.RELEASEspring-cloud-dependencies版本Dalston.SR1。现在,我决定也升级1.5.x系列的最新版本,因此我使用了Spring Boot版本1.5.18.RELEASEEdgware.SR5

当我更改版本时:authorization-server给我WebSecurityConfiguration类错误。

enter image description here

我在

上也遇到了错误

enter image description here

pom.xml

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" 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.meetup.msa</groupId>
    <artifactId>msa-parent</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <name>msa-parent</name>
    <description>Parent BOM for Microservice</description>


    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.18.RELEASE</version>
    </parent>

    <properties>
        <!-- Base directory -->
        <main.basedir>${basedir}</main.basedir>
        <!-- Encoding -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <!-- Java version -->
        <java.version>1.8</java.version>
        <!-- Logging -->
        <slf4j.version>1.7.21</slf4j.version>
        <!-- Spring Cloud -->
        <spring.cloud.version>Edgware.SR5</spring.cloud.version>
        <!-- Lombok version -->
        <lombok.version>1.16.18</lombok.version>
    </properties>

    <modules>
        <module>config-server</module>
        <module>discovery-service</module>
        <module>edge-service</module>
        <module>product-service</module>
        <module>rating-service</module>
        <module>authorization-server</module>
    </modules>

    <dependencyManagement>

        <dependencies>
            <!-- Spring Cloud 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.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <!-- Lombok dependencies -->
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
            </dependency>
        </dependencies>

    </dependencyManagement>

    <!-- Remove for release -->
    <repositories>
        <repository>
            <id>spring-release</id>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <url>http://repo.spring.io/release</url>
        </repository>
        <repository>
            <id>spring-milestone</id>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <url>http://repo.spring.io/milestone</url>
        </repository>
        <repository>
            <id>spring-snapshot</id>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <url>http://repo.spring.io/snapshot</url>
        </repository>
        <repository>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>central</id>
            <name>Maven Central</name>
            <url>http://repo1.maven.org/maven2</url>
        </repository>
        <repository>
            <id>sonatype-nexus-snapshots</id>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </repository>
    </repositories>
</project>

授权服务器pom.xml

<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>

    <parent>
        <groupId>com.meetup.msa</groupId>
        <artifactId>msa-parent</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>

    <groupId>com.meetup.msa</groupId>
    <artifactId>authorization-server</artifactId>
    <packaging>jar</packaging>

    <name>authorization-server</name>
    <description>Demo project for Spring Boot</description>

    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-oauth2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>

        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>

0 个答案:

没有答案