You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ryan Moquin <fr...@gmail.com> on 2007/07/31 22:18:01 UTC

Question about ordering of dependencies

I'm a little puzzled since I thought I understood a simple thing about how
Maven2 adds dependencies to the classpath.  If I have a dependency that is a
compile dependency and one that is a test dependency, won't the test
dependency be included in the classpath first in the test phase?  The reason
I ask, is because I'm trying to be fancy with my spring configurations.  I
have a Maven2 subproject that builds a jar including test resources and
classes.  I'm using that test jar to override a spring xml file in my
compile dependency at test time (basically two spring xml files, named the
same, but slightly different bean definitions, each in the resources
directory of the two projects).  It's odd though, because it picks up the
spring xml configuration in the compile dependency first when I use the
dependencies in a third project that attempts to use the spring xml.  If I
comment the compile dependency out, then it picks up the spring
configuration in the test jar.

Am I misunderstanding how spring does it's classloading?  Or is this a maven
oddity?  Am I even making sense?

Thanks.