2016-09-25 3 views
0

私はこのチュートリアルhttp://callistaenterprise.se/blogg/teknik/2015/04/27/building-microservices-part-3-secure-APIs-with-OAuth /を使って、Netflix OSSに基づいた組織化されたwebservicesプロジェクトを作成します。マイクロサービスspring cloud、security、oauth2、Netflix OSS @ EnableOAuth2Resourceがスプリングセキュリティ1.1に存在しない

私はスプリングセキュリティ1.1を使用しています。注釈@ EnableOAuth2Resourceはスプリングセキュリティ1.1に存在しません。何をすべきですか?

Maven依存

<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>auctionblox</groupId> 
<artifactId>auth-microservice</artifactId> 
<version>1.0</version> 
<packaging>jar</packaging> 

<parent> 
    <groupId>org.springframework.cloud</groupId> 
    <artifactId>spring-cloud-starter-parent</artifactId> 
    <version>Brixton.RELEASE</version> 
</parent> 

<properties> 
    <!-- Stand-alone RESTFul application for testing only --> 
    <start-class>io.pivotal.microservices.services.Main</start-class> 
</properties> 

<dependencies> 
    <dependency> 
     <!-- Setup Spring Boot --> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter</artifactId> 
    </dependency> 

    <!--<dependency>--> 
     <!--&lt;!&ndash; Setup Spring MVC & REST, use Embedded Tomcat &ndash;&gt;--> 
     <!--<groupId>org.springframework.boot</groupId>--> 
     <!--<artifactId>spring-boot-starter-web</artifactId>--> 
    <!--</dependency>--> 

    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-thymeleaf</artifactId> 
    </dependency> 

    <dependency> 
     <!-- Setup Spring Data common components --> 
     <groupId>org.springframework.data</groupId> 
     <artifactId>spring-data-commons</artifactId> 
    </dependency> 

    <dependency> 
     <!-- Testing starter --> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-test</artifactId> 
    </dependency> 

    <dependency> 
     <!-- Setup Spring Data JPA Repository support --> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-data-jpa</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework.cloud</groupId> 
     <artifactId>spring-cloud-starter-oauth2</artifactId> 
     <exclusions> 
      <exclusion> 
       <groupId>org.springframework.security.oauth</groupId> 
       <artifactId>spring-security-oauth2</artifactId> 
      </exclusion> 
     </exclusions> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework.security.oauth</groupId> 
     <artifactId>spring-security-oauth2</artifactId> 
     <version>2.0.10.RELEASE</version> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-security</artifactId> 
    </dependency> 

    <dependency> 
     <!-- Eureka service registration --> 
     <groupId>org.springframework.cloud</groupId> 
     <artifactId>spring-cloud-starter-eureka-server</artifactId> 
    </dependency> 

    <dependency> 
     <!-- Spring Cloud starter --> 
     <groupId>org.springframework.cloud</groupId> 
     <artifactId>spring-cloud-starter</artifactId> 
    </dependency> 

    <dependency> 
     <!-- In-memory database for testing/demos --> 
     <groupId>org.hsqldb</groupId> 
     <artifactId>hsqldb</artifactId> 
    </dependency> 





    <dependency> 
     <groupId>mysql</groupId> 
     <artifactId>mysql-connector-java</artifactId> 
     <version>5.1.39</version> 
    </dependency> 


</dependencies> 

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-maven-plugin</artifactId> 
      <executions> 
       <execution> 
        <goals> 
         <goal>repackage</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 
    </plugins> 
</build> 
</project> 
+0

?あなたの依存関係設定を共有する – bilak

+0

@bilak私はspring-cloud-security-1.1.0.RELEASE.jarを意味します。プロジェクトの説明を更新し、依存関係を追加しました –

答えて

関連する問題