[MNG-5482] detect missing Sonatype Aether classes to give a hint to

AetherClassNotFound Wiki article
This commit is contained in:
Hervé Boutemy 2013-05-30 03:10:51 +02:00
parent 22d74b0df9
commit ac64dd6bb6
1 changed files with 18 additions and 1 deletions

View File

@ -31,6 +31,7 @@
import org.apache.maven.plugin.AbstractMojoExecutionException;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.PluginContainerException;
import org.apache.maven.plugin.PluginExecutionException;
import org.apache.maven.project.ProjectBuildingException;
import org.apache.maven.project.ProjectBuildingResult;
@ -198,7 +199,23 @@ else if ( exception instanceof LinkageError )
}
else if ( exception instanceof PluginExecutionException )
{
reference = getReference( exception.getCause() );
Throwable cause = exception.getCause();
if ( cause instanceof PluginContainerException )
{
Throwable cause2 = cause.getCause();
if ( cause2 instanceof NoClassDefFoundError
&& cause2.getMessage().contains( "org/sonatype/aether/" ) )
{
reference = "AetherClassNotFound";
}
}
if ( StringUtils.isEmpty( reference ) )
{
reference = getReference( cause );
}
if ( StringUtils.isEmpty( reference ) )
{