Disable Spring Boot AutoConfiguration for transitive dependencies

I created a Spring boot project for mocking soap services - it has a dependency on org.springframework.ws:spring-ws-securityfor ws-sec header processing, which introduces a transitive dependency onorg.springframework.security:spring-security-core

Given this in my run-time class, Spring Boot thinks that I want web protection to be enabled, and even if I disable it with security.basic.enabled = false, I get a ClassNotFound class exception, unless I also add:

compile("org.springframework.security:spring-security-web:$springSecurityVersion")
compile("org.springframework.security:spring-security-config:$springSecurityVersion")

for my path to runtime classes. Is there a way to tell Boot that although it is on the classpath at runtime, that I really don't want to have anything to do with Spring Security and not require these additional dependencies?

+4
source share
1 answer

If you really do not want to do anything about it, maybe this is actually an optional dependency (and can be eliminated)? Otherwise, you can add an exception to @EnableAutoConfiguration(for example, see Javadoc for details). You would like to exclude SecurityAutoConfiguration.

0
source

Source: https://habr.com/ru/post/1526408/


All Articles