5

We've written a component based on spring-security-core and spring-test (scope test). When I ran my first test, it could't find LogFactory of commons-logging. I looked into the pom.xml of spring-security-core and was surprised that it is excluded on spring-core which usually provides this dependency. The LogFactory of commons-logging is used at compile time in different spring classes, so why it is excluded?

JFTR: If I change the order so that spring-test is listed before spring-security-core everything is ok.

Nikhil K S
  • 806
  • 1
  • 13
  • 27
lrxw
  • 3,576
  • 7
  • 32
  • 46
  • commons-logging is excluded from spring-core, however I see that commons-logging is included as a direct dependency later in the [POM](https://github.com/spring-projects/spring-security/blob/master/core/pom.xml). – user944849 Mar 26 '14 at 13:16
  • I saw that too, but nevertheless it doesnt add the dependency to my project. And I wonder why they did that. Can't they just manage the version of the dependency or override it? – lrxw Mar 28 '14 at 07:03

1 Answers1

2

I think I got it now. The import point is, that spring-security-core declares commons-logging as optional dependency. So other projects using spring security can abstain from commons-logging and use the slf4j bridge jcl-over-slf4j or whatever they like :)

This other answer helped me: https://stackoverflow.com/a/3223701/482702

Community
  • 1
  • 1
lrxw
  • 3,576
  • 7
  • 32
  • 46