Reputation: 4912
What is the significance of dependencies in pom.xml?
I have the dependencies in the following order:
If I insert Spring Security dependencies above Spring, anywhere, I get errors. For example, if I insert the two dependencies at the very top, I get this exception (also a compiler error before running):
java.lang.NoClassDefFoundError: org/springframework/core/env/EnvironmentCapable
Upvotes: 2
Views: 2706
Reputation: 16526
Dependencies order is insignificant in Maven.
After adding your Spring Security dependencies you need to remove your Spring dependency, because Spring Security references a different version of Spring which does contain this class.
So removing Spring dependency should fix this.
Upvotes: 6