This may or may not be the expected behavior. But first, just to be clear, the fact that the war and jar are in the same multi-module project is irrelevant. All that matters is the ordering of dependencies and the 'closeness' of various dependencies.
In your example, the two projectX dependencies have the same closeness (they are dependencies of dependencies). So the order in the pom is the determining factor. Try running mvn -Dverbose=true dependency:tree Justin ----- Original Message ----- From: Spam Trap <[email protected]> To: [email protected] <[email protected]> Sent: Thu Dec 11 18:33:59 2008 Subject: Unexpected version packaged in war So, I have a multi-module maven project consisting of a war project and a jar project. The jar is a dependency of the war. I'm seeing some unexpected behavior around which dependencies get bundled up in WEB-INF/lib. Namely, it seems like dependencies from the war project, either direct or transitive, are trumping dependencies of the jar (again, direct or transitive), regardless of version. For example, my jar project depends on projectX-2.0. The war depends on Y-1.1 which has a transitive dependency on projectX-1.0. When the war gets built projectX-1.0 is what winds up in WEB-INF/lib. I know I can work around this using <excluded> in the war; I'm more curious as to why this is happening. Is it a bug or intended behavior. If it's intended, what's the rationale? --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
