You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Fabrice BELLINGARD (JIRA)" <ji...@codehaus.org> on 2007/01/26 10:01:44 UTC
[jira] Created: (MNG-2795) Classloader problem loading a resource
from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
Classloader problem loading a resource from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
---------------------------------------------------------------------------------------------------------------
Key: MNG-2795
URL: http://jira.codehaus.org/browse/MNG-2795
Project: Maven 2
Issue Type: Bug
Affects Versions: 2.0.5
Reporter: Fabrice BELLINGARD
Attachments: Checkstyle-2.0.4.txt, Checkstyle-2.0.5.txt
I had a problem when executing the Checkstyle plugin (version 2.1) with the pre-release of Maven 2.0.5. So I dug a bit to see if this could be related to maven core or not, and here is what I found.
I isolated the code that breaks the build in the checkstyle plugin: it happens when the plugin tries to load my Checkstyle configuration file, which is actually located in a JAR that is specified in the build extensions. The code lies in the Locator#resolveLocation() method:
// Attempt a Resource.
URL url = this.getClass().getClassLoader().getResource( location );
This code returns null for the "url" variable, which in turns breaks the plugin because it doesn't find any configuration file.
I haven't had the time to dig more into it, but I found the following issue that might be related to this problem: "MNG-2228 : Classloader problem loading jars from build extensions". Brett and Carlos worked on it and fixed it, so maybe they could tell more about it.
I attached the logs of the execution with Maven 2.0.4 (which works fine) and Maven 2.0.5 (which breaks). I haven't had the time yet to dig further into that problem.
--
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-2795) Classloader problem loading a resource
from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
Posted by "Fabrice BELLINGARD (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-2795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_87364 ]
Fabrice BELLINGARD commented on MNG-2795:
-----------------------------------------
Well, I've just tried this test project again, with a clean installation of Maven (no local repository and the latests build of Maven 2.0.5), and when I uncomment the dependencies in the "Checkstyle-config" project's POM, then the build fails when I do the "mvn checkstyle:checkstyle" on the "TestProject" project....
This is so weird... I can't see anything specific to my environnement (Java 1.4.2_04). Have you tried with a clean installation as well?
> Classloader problem loading a resource from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
> ---------------------------------------------------------------------------------------------------------------
>
> Key: MNG-2795
> URL: http://jira.codehaus.org/browse/MNG-2795
> Project: Maven 2
> Issue Type: Bug
> Affects Versions: 2.0.5
> Reporter: Fabrice BELLINGARD
> Assigned To: Jason van Zyl
> Fix For: 2.0.5
>
> Attachments: Checkstyle-2.0.4.txt, Checkstyle-2.0.5.txt, Test-BuildExtension.zip
>
>
> I had a problem when executing the Checkstyle plugin (version 2.1) with the pre-release of Maven 2.0.5. So I dug a bit to see if this could be related to maven core or not, and here is what I found.
> I isolated the code that breaks the build in the checkstyle plugin: it happens when the plugin tries to load my Checkstyle configuration file, which is actually located in a JAR that is specified in the build extensions. The code lies in the Locator#resolveLocation() method:
> // Attempt a Resource.
> URL url = this.getClass().getClassLoader().getResource( location );
> This code returns null for the "url" variable, which in turns breaks the plugin because it doesn't find any configuration file.
> I haven't had the time to dig more into it, but I found the following issue that might be related to this problem: "MNG-2228 : Classloader problem loading jars from build extensions". Brett and Carlos worked on it and fixed it, so maybe they could tell more about it.
> I attached the logs of the execution with Maven 2.0.4 (which works fine) and Maven 2.0.5 (which breaks). I haven't had the time yet to dig further into that problem.
--
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-2795) Classloader problem loading a resource
from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
Posted by "Emmanuel Venisse (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-2795?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Emmanuel Venisse updated MNG-2795:
----------------------------------
Fix Version/s: 2.0.5
> Classloader problem loading a resource from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
> ---------------------------------------------------------------------------------------------------------------
>
> Key: MNG-2795
> URL: http://jira.codehaus.org/browse/MNG-2795
> Project: Maven 2
> Issue Type: Bug
> Affects Versions: 2.0.5
> Reporter: Fabrice BELLINGARD
> Fix For: 2.0.5
>
> Attachments: Checkstyle-2.0.4.txt, Checkstyle-2.0.5.txt
>
>
> I had a problem when executing the Checkstyle plugin (version 2.1) with the pre-release of Maven 2.0.5. So I dug a bit to see if this could be related to maven core or not, and here is what I found.
> I isolated the code that breaks the build in the checkstyle plugin: it happens when the plugin tries to load my Checkstyle configuration file, which is actually located in a JAR that is specified in the build extensions. The code lies in the Locator#resolveLocation() method:
> // Attempt a Resource.
> URL url = this.getClass().getClassLoader().getResource( location );
> This code returns null for the "url" variable, which in turns breaks the plugin because it doesn't find any configuration file.
> I haven't had the time to dig more into it, but I found the following issue that might be related to this problem: "MNG-2228 : Classloader problem loading jars from build extensions". Brett and Carlos worked on it and fixed it, so maybe they could tell more about it.
> I attached the logs of the execution with Maven 2.0.4 (which works fine) and Maven 2.0.5 (which breaks). I haven't had the time yet to dig further into that problem.
--
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-2795) Classloader problem loading a resource
from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
Posted by "Fabrice BELLINGARD (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-2795?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fabrice BELLINGARD updated MNG-2795:
------------------------------------
Attachment: Test-BuildExtension.zip
> Classloader problem loading a resource from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
> ---------------------------------------------------------------------------------------------------------------
>
> Key: MNG-2795
> URL: http://jira.codehaus.org/browse/MNG-2795
> Project: Maven 2
> Issue Type: Bug
> Affects Versions: 2.0.5
> Reporter: Fabrice BELLINGARD
> Fix For: 2.0.5
>
> Attachments: Checkstyle-2.0.4.txt, Checkstyle-2.0.5.txt, Test-BuildExtension.zip
>
>
> I had a problem when executing the Checkstyle plugin (version 2.1) with the pre-release of Maven 2.0.5. So I dug a bit to see if this could be related to maven core or not, and here is what I found.
> I isolated the code that breaks the build in the checkstyle plugin: it happens when the plugin tries to load my Checkstyle configuration file, which is actually located in a JAR that is specified in the build extensions. The code lies in the Locator#resolveLocation() method:
> // Attempt a Resource.
> URL url = this.getClass().getClassLoader().getResource( location );
> This code returns null for the "url" variable, which in turns breaks the plugin because it doesn't find any configuration file.
> I haven't had the time to dig more into it, but I found the following issue that might be related to this problem: "MNG-2228 : Classloader problem loading jars from build extensions". Brett and Carlos worked on it and fixed it, so maybe they could tell more about it.
> I attached the logs of the execution with Maven 2.0.4 (which works fine) and Maven 2.0.5 (which breaks). I haven't had the time yet to dig further into that problem.
--
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-2795) Classloader problem loading a resource
from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
Posted by "Fabrice BELLINGARD (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-2795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_87195 ]
Fabrice BELLINGARD commented on MNG-2795:
-----------------------------------------
OK, I have isolated the problem. Here it is.
I have a project "Checkstyle-config" that creates a JAR which contains a Checkstyle configuration file (called "MyConventions.xml"). I have another project "TestProject" that references this JAR in the build extensions and that configures the checkstyle plugin to use "MyConventions.xml" as the config file.
Build the "Checkstyle-config" project with "mvn install", then run "mvn checkstyle:checkstyle" on the "TestProject" Java project. Everything works fine.
Now, imagine that you develop custom Checks that you bundle in the "Checkstyle-config" JAR along with the configuration file. To be able to do so, you need to define, in that project, some dependencies (Checkstyle API dependency).
Rebuild the "Checkstyle-config" project with "mvn install" (you will get a JAR containing "MyConventions.xml" and the custom checks binaries). Then run "mvn checkstyle:checkstyle" on the "TestProject" Java project. With Maven 2.0.4, there's no error, but with 2.0.5, the build fails and the log says:
{code}
Embedded error: Unable to find configuration file location.
Unable to find location 'MyConventions.xml' as URL, File or Resource.
{code}
I will attach the projects I've described so that you can try to reproduce it. You just need to comment/uncomment the dependencies to see the build fail or not.
HTH
> Classloader problem loading a resource from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
> ---------------------------------------------------------------------------------------------------------------
>
> Key: MNG-2795
> URL: http://jira.codehaus.org/browse/MNG-2795
> Project: Maven 2
> Issue Type: Bug
> Affects Versions: 2.0.5
> Reporter: Fabrice BELLINGARD
> Fix For: 2.0.5
>
> Attachments: Checkstyle-2.0.4.txt, Checkstyle-2.0.5.txt
>
>
> I had a problem when executing the Checkstyle plugin (version 2.1) with the pre-release of Maven 2.0.5. So I dug a bit to see if this could be related to maven core or not, and here is what I found.
> I isolated the code that breaks the build in the checkstyle plugin: it happens when the plugin tries to load my Checkstyle configuration file, which is actually located in a JAR that is specified in the build extensions. The code lies in the Locator#resolveLocation() method:
> // Attempt a Resource.
> URL url = this.getClass().getClassLoader().getResource( location );
> This code returns null for the "url" variable, which in turns breaks the plugin because it doesn't find any configuration file.
> I haven't had the time to dig more into it, but I found the following issue that might be related to this problem: "MNG-2228 : Classloader problem loading jars from build extensions". Brett and Carlos worked on it and fixed it, so maybe they could tell more about it.
> I attached the logs of the execution with Maven 2.0.4 (which works fine) and Maven 2.0.5 (which breaks). I haven't had the time yet to dig further into that problem.
--
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-2795) Classloader problem loading a resource
from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
Posted by "Jason van Zyl (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-2795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_87155 ]
Jason van Zyl commented on MNG-2795:
------------------------------------
Can you give me a test project so I can verify this. I need to duplicate your setup.
> Classloader problem loading a resource from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
> ---------------------------------------------------------------------------------------------------------------
>
> Key: MNG-2795
> URL: http://jira.codehaus.org/browse/MNG-2795
> Project: Maven 2
> Issue Type: Bug
> Affects Versions: 2.0.5
> Reporter: Fabrice BELLINGARD
> Fix For: 2.0.5
>
> Attachments: Checkstyle-2.0.4.txt, Checkstyle-2.0.5.txt
>
>
> I had a problem when executing the Checkstyle plugin (version 2.1) with the pre-release of Maven 2.0.5. So I dug a bit to see if this could be related to maven core or not, and here is what I found.
> I isolated the code that breaks the build in the checkstyle plugin: it happens when the plugin tries to load my Checkstyle configuration file, which is actually located in a JAR that is specified in the build extensions. The code lies in the Locator#resolveLocation() method:
> // Attempt a Resource.
> URL url = this.getClass().getClassLoader().getResource( location );
> This code returns null for the "url" variable, which in turns breaks the plugin because it doesn't find any configuration file.
> I haven't had the time to dig more into it, but I found the following issue that might be related to this problem: "MNG-2228 : Classloader problem loading jars from build extensions". Brett and Carlos worked on it and fixed it, so maybe they could tell more about it.
> I attached the logs of the execution with Maven 2.0.4 (which works fine) and Maven 2.0.5 (which breaks). I haven't had the time yet to dig further into that problem.
--
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-2795) Classloader problem loading a resource
from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
Posted by "Julien S (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-2795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_100025 ]
Julien S commented on MNG-2795:
-------------------------------
I believe I has the same issue as reported by Fabrice, in a very similar setting (own conventions.xml and custom checker).
However, the funny part is:
mvn checkstyle:checkstyle works
mvn site fails with the above error
mvn checkstyle:checkstyle site works
I should also say and moved my custom jar from an extension to a plugin dependency too.
Hope this helps.
> Classloader problem loading a resource from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
> ---------------------------------------------------------------------------------------------------------------
>
> Key: MNG-2795
> URL: http://jira.codehaus.org/browse/MNG-2795
> Project: Maven 2
> Issue Type: Bug
> Affects Versions: 2.0.5
> Reporter: Fabrice BELLINGARD
> Assignee: Jason van Zyl
> Fix For: 2.0.5
>
> Attachments: Checkstyle-2.0.4.txt, Checkstyle-2.0.5.txt, Test-BuildExtension.zip
>
>
> I had a problem when executing the Checkstyle plugin (version 2.1) with the pre-release of Maven 2.0.5. So I dug a bit to see if this could be related to maven core or not, and here is what I found.
> I isolated the code that breaks the build in the checkstyle plugin: it happens when the plugin tries to load my Checkstyle configuration file, which is actually located in a JAR that is specified in the build extensions. The code lies in the Locator#resolveLocation() method:
> // Attempt a Resource.
> URL url = this.getClass().getClassLoader().getResource( location );
> This code returns null for the "url" variable, which in turns breaks the plugin because it doesn't find any configuration file.
> I haven't had the time to dig more into it, but I found the following issue that might be related to this problem: "MNG-2228 : Classloader problem loading jars from build extensions". Brett and Carlos worked on it and fixed it, so maybe they could tell more about it.
> I attached the logs of the execution with Maven 2.0.4 (which works fine) and Maven 2.0.5 (which breaks). I haven't had the time yet to dig further into that problem.
--
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-2795) Classloader problem loading a resource
from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
Posted by "Fabrice BELLINGARD (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-2795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_87194 ]
Fabrice BELLINGARD commented on MNG-2795:
-----------------------------------------
I've just tested my project with your freshly built version, and I'm still having the problem.
I'm currently trying to give you a simple project so that you can reproduce it. Hopefully I'll come with it soon.
> Classloader problem loading a resource from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
> ---------------------------------------------------------------------------------------------------------------
>
> Key: MNG-2795
> URL: http://jira.codehaus.org/browse/MNG-2795
> Project: Maven 2
> Issue Type: Bug
> Affects Versions: 2.0.5
> Reporter: Fabrice BELLINGARD
> Fix For: 2.0.5
>
> Attachments: Checkstyle-2.0.4.txt, Checkstyle-2.0.5.txt
>
>
> I had a problem when executing the Checkstyle plugin (version 2.1) with the pre-release of Maven 2.0.5. So I dug a bit to see if this could be related to maven core or not, and here is what I found.
> I isolated the code that breaks the build in the checkstyle plugin: it happens when the plugin tries to load my Checkstyle configuration file, which is actually located in a JAR that is specified in the build extensions. The code lies in the Locator#resolveLocation() method:
> // Attempt a Resource.
> URL url = this.getClass().getClassLoader().getResource( location );
> This code returns null for the "url" variable, which in turns breaks the plugin because it doesn't find any configuration file.
> I haven't had the time to dig more into it, but I found the following issue that might be related to this problem: "MNG-2228 : Classloader problem loading jars from build extensions". Brett and Carlos worked on it and fixed it, so maybe they could tell more about it.
> I attached the logs of the execution with Maven 2.0.4 (which works fine) and Maven 2.0.5 (which breaks). I haven't had the time yet to dig further into that problem.
--
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-2795) Classloader problem loading a resource
from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
Posted by "Jason van Zyl (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-2795?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jason van Zyl closed MNG-2795.
------------------------------
Resolution: Fixed
Used test project and everything works fine.
> Classloader problem loading a resource from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
> ---------------------------------------------------------------------------------------------------------------
>
> Key: MNG-2795
> URL: http://jira.codehaus.org/browse/MNG-2795
> Project: Maven 2
> Issue Type: Bug
> Affects Versions: 2.0.5
> Reporter: Fabrice BELLINGARD
> Assigned To: Jason van Zyl
> Fix For: 2.0.5
>
> Attachments: Checkstyle-2.0.4.txt, Checkstyle-2.0.5.txt, Test-BuildExtension.zip
>
>
> I had a problem when executing the Checkstyle plugin (version 2.1) with the pre-release of Maven 2.0.5. So I dug a bit to see if this could be related to maven core or not, and here is what I found.
> I isolated the code that breaks the build in the checkstyle plugin: it happens when the plugin tries to load my Checkstyle configuration file, which is actually located in a JAR that is specified in the build extensions. The code lies in the Locator#resolveLocation() method:
> // Attempt a Resource.
> URL url = this.getClass().getClassLoader().getResource( location );
> This code returns null for the "url" variable, which in turns breaks the plugin because it doesn't find any configuration file.
> I haven't had the time to dig more into it, but I found the following issue that might be related to this problem: "MNG-2228 : Classloader problem loading jars from build extensions". Brett and Carlos worked on it and fixed it, so maybe they could tell more about it.
> I attached the logs of the execution with Maven 2.0.4 (which works fine) and Maven 2.0.5 (which breaks). I haven't had the time yet to dig further into that problem.
--
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-2795) Classloader problem loading a resource
from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
Posted by "Josh Kitterman (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-2795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=133362#action_133362 ]
Josh Kitterman commented on MNG-2795:
-------------------------------------
I still see this issue with Maven 2.0.9. 'mvn checkstyle:checkstyle site' works, but 'mvn site' fails with the error:
Embedded error: Error rendering Maven report: Unable to find configuration file at location ...
Could not find resource ...
I have a custom jar configured as a build extension containing the configuration xml file. I can confirm it works in Maven 2.0.4, but not 2.0.5+.
> Classloader problem loading a resource from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
> ---------------------------------------------------------------------------------------------------------------
>
> Key: MNG-2795
> URL: http://jira.codehaus.org/browse/MNG-2795
> Project: Maven 2
> Issue Type: Bug
> Affects Versions: 2.0.5
> Reporter: Fabrice BELLINGARD
> Assignee: Jason van Zyl
> Fix For: 2.0.5
>
> Attachments: Checkstyle-2.0.4.txt, Checkstyle-2.0.5.txt, Test-BuildExtension.zip
>
>
> I had a problem when executing the Checkstyle plugin (version 2.1) with the pre-release of Maven 2.0.5. So I dug a bit to see if this could be related to maven core or not, and here is what I found.
> I isolated the code that breaks the build in the checkstyle plugin: it happens when the plugin tries to load my Checkstyle configuration file, which is actually located in a JAR that is specified in the build extensions. The code lies in the Locator#resolveLocation() method:
> // Attempt a Resource.
> URL url = this.getClass().getClassLoader().getResource( location );
> This code returns null for the "url" variable, which in turns breaks the plugin because it doesn't find any configuration file.
> I haven't had the time to dig more into it, but I found the following issue that might be related to this problem: "MNG-2228 : Classloader problem loading jars from build extensions". Brett and Carlos worked on it and fixed it, so maybe they could tell more about it.
> I attached the logs of the execution with Maven 2.0.4 (which works fine) and Maven 2.0.5 (which breaks). I haven't had the time yet to dig further into that problem.
--
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-2795) Classloader problem loading a resource
from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
Posted by "Jason van Zyl (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-2795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_87156 ]
Jason van Zyl commented on MNG-2795:
------------------------------------
Fabrice can you try your build with one of these builds:
http://idisk.maven.org/jvanzyl/Public/maven/
I just built 2.0.5 again. Maybe you can verify for me or give me your build so I can try.
> Classloader problem loading a resource from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
> ---------------------------------------------------------------------------------------------------------------
>
> Key: MNG-2795
> URL: http://jira.codehaus.org/browse/MNG-2795
> Project: Maven 2
> Issue Type: Bug
> Affects Versions: 2.0.5
> Reporter: Fabrice BELLINGARD
> Fix For: 2.0.5
>
> Attachments: Checkstyle-2.0.4.txt, Checkstyle-2.0.5.txt
>
>
> I had a problem when executing the Checkstyle plugin (version 2.1) with the pre-release of Maven 2.0.5. So I dug a bit to see if this could be related to maven core or not, and here is what I found.
> I isolated the code that breaks the build in the checkstyle plugin: it happens when the plugin tries to load my Checkstyle configuration file, which is actually located in a JAR that is specified in the build extensions. The code lies in the Locator#resolveLocation() method:
> // Attempt a Resource.
> URL url = this.getClass().getClassLoader().getResource( location );
> This code returns null for the "url" variable, which in turns breaks the plugin because it doesn't find any configuration file.
> I haven't had the time to dig more into it, but I found the following issue that might be related to this problem: "MNG-2228 : Classloader problem loading jars from build extensions". Brett and Carlos worked on it and fixed it, so maybe they could tell more about it.
> I attached the logs of the execution with Maven 2.0.4 (which works fine) and Maven 2.0.5 (which breaks). I haven't had the time yet to dig further into that problem.
--
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-2795) Classloader problem loading a resource
from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
Posted by "Tom Guyette (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-2795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_103055 ]
Tom Guyette commented on MNG-2795:
----------------------------------
It's not clear why this bug was closed.
We're seeing this exact issue -- checkstyle failing when a parent pom defines a dependency on a jar that contains the configuration xml file.
We see it in Maven 2.0.5 and still in Maven 2.0.7. Works fine in Maven 2.0.4.
> Classloader problem loading a resource from a build extension Jar : difference between 2.0.4 and (future) 2.0.5
> ---------------------------------------------------------------------------------------------------------------
>
> Key: MNG-2795
> URL: http://jira.codehaus.org/browse/MNG-2795
> Project: Maven 2
> Issue Type: Bug
> Affects Versions: 2.0.5
> Reporter: Fabrice BELLINGARD
> Assignee: Jason van Zyl
> Fix For: 2.0.5
>
> Attachments: Checkstyle-2.0.4.txt, Checkstyle-2.0.5.txt, Test-BuildExtension.zip
>
>
> I had a problem when executing the Checkstyle plugin (version 2.1) with the pre-release of Maven 2.0.5. So I dug a bit to see if this could be related to maven core or not, and here is what I found.
> I isolated the code that breaks the build in the checkstyle plugin: it happens when the plugin tries to load my Checkstyle configuration file, which is actually located in a JAR that is specified in the build extensions. The code lies in the Locator#resolveLocation() method:
> // Attempt a Resource.
> URL url = this.getClass().getClassLoader().getResource( location );
> This code returns null for the "url" variable, which in turns breaks the plugin because it doesn't find any configuration file.
> I haven't had the time to dig more into it, but I found the following issue that might be related to this problem: "MNG-2228 : Classloader problem loading jars from build extensions". Brett and Carlos worked on it and fixed it, so maybe they could tell more about it.
> I attached the logs of the execution with Maven 2.0.4 (which works fine) and Maven 2.0.5 (which breaks). I haven't had the time yet to dig further into that problem.
--
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