You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Brett Porter (JIRA)" <ji...@codehaus.org> on 2008/12/18 15:18:19 UTC

[jira] Updated: (MNG-2690) DefaultPluginManager.getConfiguredMojo() doesn't handle NoClassDefFoundError correctly

     [ http://jira.codehaus.org/browse/MNG-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter updated MNG-2690:
------------------------------

    Affects Version/s: 2.1.0-M3

common nuisance error - wuld be good to fix

> DefaultPluginManager.getConfiguredMojo() doesn't handle NoClassDefFoundError correctly
> --------------------------------------------------------------------------------------
>
>                 Key: MNG-2690
>                 URL: http://jira.codehaus.org/browse/MNG-2690
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Plugins and Lifecycle
>    Affects Versions: 2.0.4, 2.1.0-M3
>            Reporter: Aaron Digulla
>             Fix For: Reviewed Pending Version Assignment
>
>
> If maven tries to download a file which doesn't exist and it believes there is no other place where it can get the file, you can have the situation that Maven tries to invoke a Plugin without a complete classpath. In the log, you'll see something like this:
> Downloading: http://repository.codehaus.org/org/codehaus/mojo/dependency-maven-plugin/1.0/dependency-maven-plugin-1.0.pom
> Downloading: http://repo1.maven.org/maven2/org/codehaus/mojo/dependency-maven-plugin/1.0/dependency-maven-plugin-1.0.jar
> 15K downloaded
> As you can see, Maven tries to download the POM from a different site than the JAR. Now, the classpath of the JAR is incomplete because the POM is missing. Things get really nasty when Maven tries to access the plugin. You'll get:
> java.lang.NoClassDefFoundError: Lorg/codehaus/plexus/archiver/manager/ArchiverManager;
> which tells you exactly nothing since you have no idea who wants that class. The cause of the problem is that PlexusContainer doesn't catch errors (well, Java says you shouldn't but the user would really like to see what's going on).
> My fix was to duplicate the catch in DefaultPluginManager.getConfiguredMojo() (around line 530):
>         catch ( NoClassDefFoundError e )
>         {
>             throw new PluginManagerException( "Unable to find the mojo '" + mojoDescriptor.getRoleHint() +
>                 "' in the plugin '" + pluginDescriptor.getPluginLookupKey() + "' because of NoClassDefFoundError:", e );
>         }
> This way, I get at least an idea which plugin is causing the problem.
> But I guess the container should be fixed to catch these errors.

-- 
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