[ http://jira.codehaus.org/browse/MSUREFIRE-115?page=comments#action_76786 ] Ronny Naess commented on MSUREFIRE-115: ---------------------------------------
Anything new in this matter? I have testresources in two test dependent jars. My artifacts has who depends this test-jars containing needed resources has randomly success and failure. If I run "mvn -X test" I can se the log output listing my test classpath and it is correct. However that may not be the case. Two artifacts may run tests as expected (aka finding test resources) while the next artifact up for test may fail. I have listet the resources from the classloader and It proves that while the test classpath listing says my test-jar is there, the actual output (file read with ouput to screen) says something else. I have the same resources (file names not content) for main and test, and I have to list the file content to se the difference. My current solution is to run the tests in Eclipse and skip them in maven so we can have successfully builds. I do not like doing it this way since this breakes the development process since a developer may forget to test or retest for that matter and with the risk of checking in code that may fail. The strange thing is that it is so random. One time it may work and the next it may fail. I have tried fork and childclasspath settings and none worked. > Classloading problem for getting a resource > ------------------------------------------- > > Key: MSUREFIRE-115 > URL: http://jira.codehaus.org/browse/MSUREFIRE-115 > Project: Maven 2.x Surefire Plugin > Issue Type: Bug > Affects Versions: 2.2, 2.1.3 > Environment: Maven 2.0.4 > Windows XP > Reporter: Wim Deblauwe > Priority: Blocker > Fix For: 2.3 > > Attachments: surefire-test.zip, workaround-for-fork.zip > > > We are using Betwixt and some of our unit tests fail when run using > surefire, but run fine in IntelliJ or Maven 1. Betwixt looks for > descriptors with the name of the class + .betwixt to control how > something is written out in XML. It uses the construct: > myClass.getResource() to find the .betwixt file. > E.g. com.mycomp.MyClass -> com/mycomp/MyClass.betwixt > We have a betwixt file for the java.util.Date class. However, betwixt > seems to be unable to pick it up when using surefire. I have created a > small test that shows the problem and have attached it. > I tried with version 2.2 using different configurations (never, once, > pertest) and with version 2.1.3 (default configuration) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira