<unitTest> <includes> <include>**/*Test.java</includes> </includes> <resources> <resource> <directory>src/java</directory> <includes> <include>**/*.properties</include> </includes> </resource> </resources> </unitTest>
The only problem I've seen with this is that the 'test:test-resources' task doesn't seem to execute this if you invoke this project from another one using Reactor (can anyone shed some light on this?). So the other way you could do it is to add a <postGoal> definition to the maven.xml file (same directory as your project.xml) that looks like this:
<postGoal name="test:compile"> <ant:copy dir="${maven.build.dir}/test-classes"> <ant:fileset dir="${basedir}/src/java"> <ant:includes> <ant:include name="**/*.properties"/> </ant:includes> </ant:fileset> </ant:copy> </postGoal>
Either way, the net effect is to put these files in the target/test-classes directory so that when you run your unit-tests these files show up in the CLASSPATH.
--Alex
Steve Garcia wrote:
I wish to add additional classpath entries when I run
maven test
because there are additional resources that must be present in the classpath. For instance I am generating test cases that test ResourceBundles, so I need the .properties files in the classpath. How can I accomplish this?
Thanks, Steve
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]