You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Olivier Lamy (JIRA)" <ji...@codehaus.org> on 2010/01/27 14:41:55 UTC
[jira] Created: (MNG-4548)
Thread.currentThread().getContextClassLoader().getResource doesn't find
resource
Thread.currentThread().getContextClassLoader().getResource doesn't find resource
---------------------------------------------------------------------------------
Key: MNG-4548
URL: http://jira.codehaus.org/browse/MNG-4548
Project: Maven 2 & 3
Issue Type: Bug
Components: Class Loading
Affects Versions: 3.0-alpha-6
Reporter: Olivier Lamy
Thread.currentThread().getContextClassLoader().getResource cannot find a resource whereas getClass().getResource find it.
Sample to test it :
svn co https://svn.codehaus.org/mojo/branches/sonar-maven-plugin-mvn-3.x/experimental/
cd experimental
mvn clean install -Prun-its -Dinvoker.streamLogs=true
--
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
[jira] Closed: (MNG-4548)
Thread.currentThread().getContextClassLoader().getResource doesn't find
resource
Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4548?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Olivier Lamy closed MNG-4548.
-----------------------------
Resolution: Not A Bug
Assignee: Olivier Lamy
olamy need to sleep (simply fixing it with removing first leading slash)
> Thread.currentThread().getContextClassLoader().getResource doesn't find resource
> ---------------------------------------------------------------------------------
>
> Key: MNG-4548
> URL: http://jira.codehaus.org/browse/MNG-4548
> Project: Maven 2 & 3
> Issue Type: Bug
> Components: Class Loading
> Affects Versions: 3.0-alpha-6
> Reporter: Olivier Lamy
> Assignee: Olivier Lamy
>
> Thread.currentThread().getContextClassLoader().getResource cannot find a resource whereas getClass().getResource find it.
> Sample to test it :
> svn co https://svn.codehaus.org/mojo/branches/sonar-maven-plugin-mvn-3.x/experimental/
> cd experimental
> mvn clean install -Prun-its -Dinvoker.streamLogs=true
--
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
[jira] Commented: (MNG-4548)
Thread.currentThread().getContextClassLoader().getResource doesn't find
resource
Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=208331#action_208331 ]
Olivier Lamy commented on MNG-4548:
-----------------------------------
It concerns sonar migration to maven3.
For more details : http://n2.nabble.com/Upgrade-to-maven-3-td4459836.html#a4459836
> Thread.currentThread().getContextClassLoader().getResource doesn't find resource
> ---------------------------------------------------------------------------------
>
> Key: MNG-4548
> URL: http://jira.codehaus.org/browse/MNG-4548
> Project: Maven 2 & 3
> Issue Type: Bug
> Components: Class Loading
> Affects Versions: 3.0-alpha-6
> Reporter: Olivier Lamy
>
> Thread.currentThread().getContextClassLoader().getResource cannot find a resource whereas getClass().getResource find it.
> Sample to test it :
> svn co https://svn.codehaus.org/mojo/branches/sonar-maven-plugin-mvn-3.x/experimental/
> cd experimental
> mvn clean install -Prun-its -Dinvoker.streamLogs=true
--
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
[jira] Commented: (MNG-4548)
Thread.currentThread().getContextClassLoader().getResource doesn't find
resource
Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=208328#action_208328 ]
Olivier Lamy commented on MNG-4548:
-----------------------------------
in TargetMojo#execute
{code}
// the file /META-INF/persistence.xml is included in the dependency sonar-plugin-api-1.12.jar
URL resource = getClass().getResource("/META-INF/persistence.xml");
System.out.println("getClass().getResource(): " + resource);
resource = getClass().getClassLoader().getResource("/META-INF/persistence.xml");
System.out.println("getClass().getClassLoader().getResource(): " + resource);
resource = Thread.currentThread().getContextClassLoader().getResource("/META-INF/persistence.xml");
System.out.println("Thread.currentThread().getContextClassLoader().getResource(): " + resource);
{code}
> Thread.currentThread().getContextClassLoader().getResource doesn't find resource
> ---------------------------------------------------------------------------------
>
> Key: MNG-4548
> URL: http://jira.codehaus.org/browse/MNG-4548
> Project: Maven 2 & 3
> Issue Type: Bug
> Components: Class Loading
> Affects Versions: 3.0-alpha-6
> Reporter: Olivier Lamy
>
> Thread.currentThread().getContextClassLoader().getResource cannot find a resource whereas getClass().getResource find it.
> Sample to test it :
> svn co https://svn.codehaus.org/mojo/branches/sonar-maven-plugin-mvn-3.x/experimental/
> cd experimental
> mvn clean install -Prun-its -Dinvoker.streamLogs=true
--
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
[jira] Commented: (MNG-4548)
Thread.currentThread().getContextClassLoader().getResource doesn't find
resource
Posted by "Milos Kleint (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=208330#action_208330 ]
Milos Kleint commented on MNG-4548:
-----------------------------------
context classloader usage can have unwanted sideeffects in embedded execution. Eg. in netbeans module system it will see all modules content in the IDE.
> Thread.currentThread().getContextClassLoader().getResource doesn't find resource
> ---------------------------------------------------------------------------------
>
> Key: MNG-4548
> URL: http://jira.codehaus.org/browse/MNG-4548
> Project: Maven 2 & 3
> Issue Type: Bug
> Components: Class Loading
> Affects Versions: 3.0-alpha-6
> Reporter: Olivier Lamy
>
> Thread.currentThread().getContextClassLoader().getResource cannot find a resource whereas getClass().getResource find it.
> Sample to test it :
> svn co https://svn.codehaus.org/mojo/branches/sonar-maven-plugin-mvn-3.x/experimental/
> cd experimental
> mvn clean install -Prun-its -Dinvoker.streamLogs=true
--
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
[jira] Updated: (MNG-4548)
Thread.currentThread().getContextClassLoader().getResource doesn't find
resource
Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4548?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Olivier Lamy updated MNG-4548:
------------------------------
svn rev 11726 of https://svn.codehaus.org/mojo/branches/sonar-maven-plugin-mvn-3.x/experimental/
There is only one IT.
> Thread.currentThread().getContextClassLoader().getResource doesn't find resource
> ---------------------------------------------------------------------------------
>
> Key: MNG-4548
> URL: http://jira.codehaus.org/browse/MNG-4548
> Project: Maven 2 & 3
> Issue Type: Bug
> Components: Class Loading
> Affects Versions: 3.0-alpha-6
> Reporter: Olivier Lamy
>
> Thread.currentThread().getContextClassLoader().getResource cannot find a resource whereas getClass().getResource find it.
> Sample to test it :
> svn co https://svn.codehaus.org/mojo/branches/sonar-maven-plugin-mvn-3.x/experimental/
> cd experimental
> mvn clean install -Prun-its -Dinvoker.streamLogs=true
--
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