Skip to content
This repository has been archived by the owner on May 31, 2022. It is now read-only.

@EnableResourceServer annotation is not detected. #1327

Open
aniketcg1 opened this issue Apr 2, 2018 · 3 comments
Open

@EnableResourceServer annotation is not detected. #1327

aniketcg1 opened this issue Apr 2, 2018 · 3 comments

Comments

@aniketcg1
Copy link

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.

@AntonyBaasan
Copy link

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.

@aniketcg1
Copy link
Author

Thanks for your comment!

@mithildeeva
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants