<!-- DIV {margin:0px;}Hi -
I am using Maven 2.0.4 and JDK 1.5. I have a components.xml file that I use to
define components related to my application sitting in the current project's
META-INF/plexus folder. I have a simple test case that calls getResource on the
class and classloader to look up /META-INF/plexus/components.xml resource. When
I run the test case through maven surefire plugin, what I get back is NOT my
current project's components.xml file, but, the components.xml from one of the
dependency jar files. If I call getResources and list the components.xml files
out, the current project's file is at the end.
When I run the test case using mvn -x, I see that classpathElements has
target/classes and target/test-classes right up top. But, it does not find the
local file first.
The same issue exists with any custom plugin I create. If I get the current
thread's context class loader and look up components.xml, it returns the
current project's (from where I run the plugin) resource at the end. This also
applies to any other kind of resources (such us multiple log4j.properties files
in the classpath) that exist in the dependency jar and in the current project.
I want to be able to pickup the local file first and then the one from the
dependency jar. Any suggestions?
Thanks.