msg.append( " # mvn help:describe -Dplugin=org.apache.maven.plugins:maven-help-plugin\n" );
msg.append( "or\n" );
msg.append( " # mvn help:describe -DgroupId=org.apache.maven.plugins -DartifactId=maven-help-plugin\n\n" );
msg.append( "Try 'mvn help:help -Ddetail=true' for more information." );
throw new MojoFailureException( msg.toString() );
}
if ( descriptor == null && forLookup != null )
{
try
{
descriptor = pluginManager.loadPluginDescriptor( forLookup, project, session );
}
catch ( ArtifactResolutionException e )
{
throw new MojoExecutionException(
"Error retrieving plugin descriptor for:\n\ngroupId: '" + groupId + "'\nartifactId: '" + artifactId
+ "'\nversion: '" + version + "'\n\n", e );
}
catch ( PluginManagerException e )
{
throw new MojoExecutionException(
"Error retrieving plugin descriptor for:\n\ngroupId: '" + groupId + "'\nartifactId: '" + artifactId
+ "'\nversion: '" + version + "'\n\n", e );
}
catch ( PluginVersionResolutionException e )
{
throw new MojoExecutionException(
"Error retrieving plugin descriptor for:\n\ngroupId: '" + groupId + "'\nartifactId: '" + artifactId
+ "'\nversion: '" + version + "'\n\n", e );
}
catch ( ArtifactNotFoundException e )
{
throw new MojoExecutionException( "Plugin dependency does not exist: " + e.getMessage(), e );
}
catch ( InvalidVersionSpecificationException e )
{
throw new MojoExecutionException(
"Error retrieving plugin descriptor for:\n\ngroupId: '" + groupId + "'\nartifactId: '" + artifactId
+ "'\nversion: '" + version + "'\n\n", e );
}
catch ( InvalidPluginException e )
{
throw new MojoExecutionException(
"Error retrieving plugin descriptor for:\n\ngroupId: '" + groupId + "'\nartifactId: '" + artifactId
+ "'\nversion: '" + version + "'\n\n", e );
}
catch ( PluginNotFoundException e )
{
if ( getLog().isDebugEnabled() )
{
getLog().debug( "Unable to find plugin", e );
}
throw new MojoFailureException( "Plugin does not exist: " + e.getMessage() );
}
catch ( PluginVersionNotFoundException e )
{
if ( getLog().isDebugEnabled() )
{
getLog().debug( "Unable to find plugin version", e );
}
throw new MojoFailureException( e.getMessage() );
}
}
if ( descriptor == null )
{
throw new MojoFailureException( "Plugin could not be found. If you believe it is correct,"
+ " check your pluginGroups setting, and run with -U to update the remote configuration" );
}
return descriptor;
}