Spring-security-oauth: @EnableResourceServer annotation is not detected.

Created on 2 Apr 2018  路  3Comments  路  Source: spring-projects/spring-security-oauth

I am using spring boot with parent

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.0.M7</version>
    <relativePath/> <!-- lookup parent from repository -->
  </parent>

I want to include spring security in my project . Hence I included following dependencies.

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

but problem is when I annotate spring boot application with @EnableResourceServer, It is not detecting annotation.

waiting-for-triage

Most helpful comment

I put version and it works

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

No an expert in Maven, but would be thankeful if someone can explain that.

All 3 comments

I put version and it works

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

No an expert in Maven, but would be thankeful if someone can explain that.

Thanks for your comment!

@AntonyBaasan @EnableResourceServer feature was moved to separate library in later version
Not explicitly mentioning the version makes maven pick the latest compatible version

Found the annotation under oauth2 starter

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-oauth2</artifactId>
</dependency>

Was this page helpful?
0 / 5 - 0 ratings