I am running with maven 3.1.1 and the dependency spring-expression
is correctly added to WEB-INF/lib. The effective pom does not contain spring-expression
, but that is normal as the effective pom does not resolve transitive dependencies.
The effective pom is just a merged xml file with the current pom plus all it's parents merged together. The maven dependency resolution mechanism is applied only after the effective pom is built.
This is the reason why the effective pom only contains the spring-context
dependency, because that was the only thing specified in the pom.xml. If there would be parent dependencies in a parent pom they would show up in the effective pom too.
This is my output of mvn dependency:tree:
INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ test-project ---
[INFO] org.test.project:test-project:war:0.1-SNAPSHOT
[INFO] \- org.springframework:spring-context:jar:3.2.4.RELEASE:runtime
[INFO] +- org.springframework:spring-aop:jar:3.2.4.RELEASE:runtime
[INFO] | \- aopalliance:aopalliance:jar:1.0:runtime
[INFO] +- org.springframework:spring-beans:jar:3.2.4.RELEASE:runtime
[INFO] +- org.springframework:spring-core:jar:3.2.4.RELEASE:runtime
[INFO] | \- commons-logging:commons-logging:jar:1.1.1:runtime
[INFO] \- org.springframework:spring-expression:jar:3.2.4.RELEASE:runtime
and these is my WEB-INF/lib contents:
aopalliance-1.0.jar
commons-logging-1.1.1.jar
spring-aop-3.2.4.RELEASE.jar
spring-beans-3.2.4.RELEASE.jar
spring-context-3.2.4.RELEASE.jar
spring-core-3.2.4.RELEASE.jar
spring-expression-3.2.4.RELEASE.jar
So the issue seems to be some misunderstanding of the effective pom feature together with a missing dependency spring-expression
in WEB-INF lib due to a maven bug: this problem is solvable via version upgrade or hardcoding dependency on the pom as workaround as you found out.