I have a couple of observations... First off I see you're writing you unit tests in Groovy! That's a good thing of course for far too many reasons. It's also an important detail to pay attention to. There are a hole host of other details to look at as well. Secondly it appears you are trying to query for the resource folder using code. This is not a good thing or a necessary thing to do. Maven will put all of your "test resources" under the test-classes folder unless something else somewhere else tells it not to. Another detail is that your code is asking the wrong question and may have been mistakenly getting at the right answer all along. It asks the location of it's execution folder not the location of the resource folder. I can show you the correct hack to locating the resource folder involving a marker file which you could run and arrive at a more accurate answer. More on that later. Here's the important things to consider. Groovy is interpreted/compiled. Running that same groovy code through a plugin (like the Groovy plugin or Ant run) would place compiled classes in your classes output folder. In one case I'm assuming the code was being copied from the test/resources to the test-classes folder and in another case it is possibly being filtered. I can't tell without looking.
Here's some things to look for. Find out where the Groovy code is being run from. Is it being both compiled to target/classes and copied over to target/test-classes as .groovy files? If so then there's some ambiguity worth cleaning up. What is it you are actually trying to do? Do you want to run the scripts or do you want to compile them? If you are compiling them make sure you point the compiler to the correct output folder. I feel like I'm babbling and confusing you more than helping but I'm sure your problem lies in whther you compile to the correct output folder or copy to the correct output folder. Look for filters that may have been added as well. jlo_gestalt wrote: > > When trying to access test resources in my unit tests, maven 2.0.8 and > above are returning the wrong directory. > > Here is my basic code to access the folder > def file = new JmblXsltDriverTest().getClass().getResource("/")?.file > println file > > On 2.0.7 this would print > /workspace/checkout/weather/trunk/jetjwis/jbi/jmbl-xslt/target/test-classes/ > > On 2.0.8 and 2.0.9 this prints > /workspace/checkout/weather/trunk/jetjwis/jbi/jmbl-xslt/target/classes/ > > To me this is a critical bug that would almost certainly cause every > projects unit tests that access test resources to fail. > > > -- View this message in context: http://www.nabble.com/Test-classpath-issue-with-v2.0.8-and-v2.0.9-tp17276386p17281319.html Sent from the Maven - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]