Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enforce a specific Spring Security version dependency in Spring Boot

How do you ensure Spring Security >3.2.1 is used in accordance with this documented, bug?:

class path resource [org/springframework/security/config/annotation/authentication/configurers/GlobalAuthenticationConfigurerAdapter.class] 
cannot be opened because it does not exist

I've tried upgrading it in my POM.xml with no luck (Intellij complains the version doesn't exist):

enter image description here

My local repository path in Intellij Maven Settings is correct. I hover over its complaint and select "Update Maven Indices". It tries to update my local repository, returning only that the dependencies do not exist.

So, how else can I ensure GlobalAuthenticationConfigurerAdapter.class is found?

like image 903
ecoe Avatar asked Oct 21 '25 15:10

ecoe


1 Answers

I think the current answer to this question can be found here:

Gradle

https://docs.spring.io/spring-security/reference/getting-spring-security.html#getting-gradle-boot

e.g. for Spring Security version 5.7.0-SNAPSHOT specify property

ext['spring-security.version']='5.7.0-SNAPSHOT'

in your Gradle file

Maven

https://docs.spring.io/spring-security/reference/getting-spring-security.html#getting-maven-boot

e.g. for Spring Security version 5.7.0-SNAPSHOT specify property

<properties>
    <!-- ... -->
    <spring-security.version>5.7.0-SNAPSHOT</spring-security.version>
</properties>

Also remember that if you're going to try out new builds that might not exist in public Maven repositories, you might have to add Spring's own repositories, for example https://repo.spring.io/snapshot.

like image 111
fast-reflexes Avatar answered Oct 24 '25 06:10

fast-reflexes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!