You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dan Fabulich (JIRA)" <ji...@codehaus.org> on 2007/11/24 05:14:57 UTC
[jira] Closed: (SUREFIRE-286) ClassLoader.getSystemResource(String)
returns null with valid resource
[ http://jira.codehaus.org/browse/SUREFIRE-286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dan Fabulich closed SUREFIRE-286.
---------------------------------
Resolution: Won't Fix
Fix Version/s: (was: 2.4)
This test passes as-is if you set useSystemClassLoader=true in the latest 2.4 trunk. Others have suggested other useful workarounds. It's annoying that you have to set useSystemClassLoader=true (it should really be the default), but that would cause a lot of other related problems, for example SUREFIRE-334. So, for now, you'll need to use one of the workarounds.
> ClassLoader.getSystemResource(String) returns null with valid resource
> ----------------------------------------------------------------------
>
> Key: SUREFIRE-286
> URL: http://jira.codehaus.org/browse/SUREFIRE-286
> Project: Maven Surefire
> Issue Type: Bug
> Components: classloading
> Affects Versions: 2.0 Report Plugin
> Environment: Windows XP
> Reporter: Jamo Smith
> Priority: Minor
> Attachments: mvntest.zip
>
>
> src/main/java/org/mvntest/TinyGetter.java does this:
> URL url = ClassLoader.getSystemResource("tiny.gif");
> tiny.gif is located in
> src/main/resources
> a TestCase can be found in src/test/java/org/mvntest/TinyGetterTest.java
> which fails with NPE (url is null)
> I believe this TestCase ought to be successful, since tiny.gif should be in the classpath during tests (how else do you have a simulated test environment?). I tried placing tiny.gif in src/main/java, src/test/java and src/test/resources with no luck anywhere. Although I believe this should work even if it is only in src/main/resources
> A full, isolated, maven2 project is attached.
> Thanks, and I hope I'm not over looking something. If I am, I apologize in advance.
--
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