Renamed Plugin.java, AbstractPlugin.java, PluginExecutionRe(quest|sponse) PluginExecutionException to Mojo*

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@165238 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2005-04-29 00:12:09 +00:00
parent c61b86287e
commit a58632b9dd
34 changed files with 153 additions and 153 deletions

View File

@ -16,8 +16,8 @@ package org.apache.maven.plugin.coreit;
* limitations under the License.
*/
import org.apache.maven.plugin.AbstractPlugin;
import org.apache.maven.plugin.PluginExecutionException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import java.io.IOException;
import java.io.File;
@ -31,7 +31,7 @@ import java.io.FileWriter;
* @description Goal which cleans the build
*/
public class CoreItMojo
extends AbstractPlugin
extends AbstractMojo
{
/**
* @parameter expression="${project.build.directory}"
@ -55,7 +55,7 @@ public class CoreItMojo
private String goalItem = "bar";
public void execute()
throws PluginExecutionException
throws MojoExecutionException
{
touch( new File( outputDirectory ), "touch.txt" );
@ -64,7 +64,7 @@ public class CoreItMojo
if ( basedirAlignmentDirectory.getPath().equals( "target/test-basedir-alignment" ) )
{
throw new PluginExecutionException( "basedirAlignmentDirectory not aligned" );
throw new MojoExecutionException( "basedirAlignmentDirectory not aligned" );
}
touch( basedirAlignmentDirectory, "touch.txt" );
@ -82,7 +82,7 @@ public class CoreItMojo
}
private static void touch( File dir, String file )
throws PluginExecutionException
throws MojoExecutionException
{
try
{
@ -101,7 +101,7 @@ public class CoreItMojo
}
catch ( IOException e )
{
throw new PluginExecutionException( "Error touching file", e );
throw new MojoExecutionException( "Error touching file", e );
}
}
}

View File

@ -27,7 +27,7 @@ import org.apache.maven.lifecycle.LifecycleExecutionException;
import org.apache.maven.lifecycle.LifecycleExecutor;
import org.apache.maven.monitor.event.EventDispatcher;
import org.apache.maven.monitor.event.MavenEvents;
import org.apache.maven.plugin.PluginExecutionException;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectBuilder;
import org.apache.maven.project.ProjectBuildingException;
@ -236,11 +236,11 @@ public class DefaultMaven
// TODO: yuck! Revisit when cleaning up the exception handling from the top down
Throwable exception = response.getException();
if ( exception instanceof PluginExecutionException )
if ( exception instanceof MojoExecutionException )
{
if ( exception.getCause() == null )
{
PluginExecutionException e = (PluginExecutionException) exception;
MojoExecutionException e = (MojoExecutionException) exception;
logFailure( response, e, e.getLongMessage() );
}
else

View File

@ -37,7 +37,7 @@ import org.apache.maven.monitor.event.DefaultEventDispatcher;
import org.apache.maven.monitor.event.DefaultEventMonitor;
import org.apache.maven.monitor.event.EventDispatcher;
import org.apache.maven.monitor.logging.DefaultLog;
import org.apache.maven.plugin.Plugin;
import org.apache.maven.plugin.Mojo;
import org.apache.maven.reactor.ReactorException;
import org.apache.maven.settings.MavenSettingsBuilder;
import org.apache.maven.settings.Profile;
@ -264,7 +264,7 @@ public class MavenCli
}
// TODO [BP]: do we set one per mojo? where to do it?
Logger logger = manager.getLoggerForComponent( Plugin.ROLE );
Logger logger = manager.getLoggerForComponent( Mojo.ROLE );
if ( logger != null )
{
request.setLog( new DefaultLog( logger ) );

View File

@ -28,7 +28,7 @@ import org.apache.maven.model.Plugin;
import org.apache.maven.model.PluginManagement;
import org.apache.maven.monitor.event.EventDispatcher;
import org.apache.maven.monitor.event.MavenEvents;
import org.apache.maven.plugin.PluginExecutionException;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.PluginManager;
import org.apache.maven.plugin.PluginManagerException;
import org.apache.maven.plugin.PluginNotFoundException;
@ -93,7 +93,7 @@ public class DefaultLifecycleExecutor
{
processGoals( session, tasks );
}
catch ( PluginExecutionException e )
catch ( MojoExecutionException e )
{
response.setException( e );
}
@ -115,7 +115,7 @@ public class DefaultLifecycleExecutor
private void processGoals( MavenSession session, List tasks )
throws ArtifactHandlerNotFoundException, LifecycleExecutionException, PluginNotFoundException,
PluginExecutionException, ArtifactResolutionException
MojoExecutionException, ArtifactResolutionException
{
Map phaseMap = new HashMap();
@ -406,7 +406,7 @@ public class DefaultLifecycleExecutor
}
private void executePhase( String phase, MavenSession session, Map phaseMap )
throws PluginExecutionException, PluginNotFoundException, PluginManagerException, ArtifactResolutionException,
throws MojoExecutionException, PluginNotFoundException, PluginManagerException, ArtifactResolutionException,
LifecycleExecutionException
{
// only execute up to the given phase
@ -437,7 +437,7 @@ public class DefaultLifecycleExecutor
}
}
}
catch ( PluginExecutionException e )
catch ( MojoExecutionException e )
{
dispatcher.dispatchError( event, p.getId(), e );
throw e;
@ -458,7 +458,7 @@ public class DefaultLifecycleExecutor
}
protected void executeMojo( String id, MavenSession session )
throws PluginExecutionException, PluginNotFoundException, PluginManagerException, ArtifactResolutionException,
throws MojoExecutionException, PluginNotFoundException, PluginManagerException, ArtifactResolutionException,
LifecycleExecutionException
{
// ----------------------------------------------------------------------
@ -481,7 +481,7 @@ public class DefaultLifecycleExecutor
if ( mojoDescriptor == null )
{
throw new PluginExecutionException( "Unable to find goal: " + id );
throw new MojoExecutionException( "Unable to find goal: " + id );
}
if ( mojoDescriptor.getExecutePhase() != null )

View File

@ -159,7 +159,7 @@ public class DefaultPluginManager
}
// ----------------------------------------------------------------------
// Plugin discovery
// Mojo discovery
// ----------------------------------------------------------------------
public void componentDiscovered( ComponentDiscoveryEvent event )
@ -314,13 +314,13 @@ public class DefaultPluginManager
}
// ----------------------------------------------------------------------
// Plugin execution
// Mojo execution
// ----------------------------------------------------------------------
public void executeMojo( MavenSession session, MojoDescriptor mojoDescriptor )
throws ArtifactResolutionException, PluginManagerException, PluginExecutionException
throws ArtifactResolutionException, PluginManagerException, MojoExecutionException
{
PluginExecutionRequest request = null;
MojoExecutionRequest request = null;
if ( mojoDescriptor.getRequiresDependencyResolution() != null )
{
@ -354,13 +354,13 @@ public class DefaultPluginManager
}
}
Plugin plugin = null;
Mojo plugin = null;
String goalName = mojoDescriptor.getId();
try
{
plugin = (Plugin) container.lookup( Plugin.ROLE, goalName );
plugin = (Mojo) container.lookup( Mojo.ROLE, goalName );
plugin.setLog( session.getLog() );
@ -420,7 +420,7 @@ public class DefaultPluginManager
}
catch ( ExpressionEvaluationException e )
{
throw new PluginExecutionException( "Unable to configure plugin", e );
throw new MojoExecutionException( "Unable to configure plugin", e );
}
// !! This is ripe for refactoring to an aspect.
@ -442,7 +442,7 @@ public class DefaultPluginManager
dispatcher.dispatchEnd( event, goalName );
}
catch ( PluginExecutionException e )
catch ( MojoExecutionException e )
{
session.getEventDispatcher().dispatchError( event, goalName, e );
throw e;
@ -453,11 +453,11 @@ public class DefaultPluginManager
catch ( PluginConfigurationException e )
{
String msg = "Error configuring plugin for execution of '" + goalName + "'.";
throw new PluginExecutionException( msg, e );
throw new MojoExecutionException( msg, e );
}
catch ( ComponentLookupException e )
{
throw new PluginExecutionException( "Error looking up plugin: ", e );
throw new MojoExecutionException( "Error looking up plugin: ", e );
}
finally
{
@ -564,7 +564,7 @@ public class DefaultPluginManager
// intentionally ignored
Class superclass = aClass.getSuperclass();
if ( superclass != AbstractPlugin.class )
if ( superclass != AbstractMojo.class )
{
return checkMojoTechnique( superclass );
}
@ -582,7 +582,7 @@ public class DefaultPluginManager
* @return
* @deprecated
*/
private static PluginExecutionRequest createPluginRequest( PlexusConfiguration configuration, Map map )
private static MojoExecutionRequest createPluginRequest( PlexusConfiguration configuration, Map map )
{
Map parameters = new HashMap();
PlexusConfiguration[] children = configuration.getChildren();
@ -592,10 +592,10 @@ public class DefaultPluginManager
parameters.put( child.getName(), child.getValue( null ) );
}
map = CollectionUtils.mergeMaps( map, parameters );
return new PluginExecutionRequest( map );
return new MojoExecutionRequest( map );
}
private void populatePluginFields( Plugin plugin, PlexusConfiguration configuration, Map map,
private void populatePluginFields( Mojo plugin, PlexusConfiguration configuration, Map map,
ExpressionEvaluator expressionEvaluator )
throws PluginConfigurationException
{

View File

@ -58,7 +58,7 @@ public class MavenMojoDescriptor
public String getRole()
{
return Plugin.ROLE;
return Mojo.ROLE;
}
public String getRoleHint()

View File

@ -31,7 +31,7 @@ public interface PluginManager
String ROLE = PluginManager.class.getName();
void executeMojo( MavenSession session, MojoDescriptor mojoDescriptor )
throws PluginExecutionException, PluginManagerException, ArtifactResolutionException;
throws MojoExecutionException, PluginManagerException, ArtifactResolutionException;
MojoDescriptor getMojoDescriptor( String goalId );

View File

@ -29,7 +29,7 @@ public class PluginNotFoundException
{
public PluginNotFoundException( String groupId, String artifactId, String version, ArtifactResolutionException e )
{
super( "Plugin could not be found - check that the goal name is correct", groupId, artifactId, version,
super( "Mojo could not be found - check that the goal name is correct", groupId, artifactId, version,
"maven-plugin", e );
}
}

View File

@ -52,7 +52,7 @@
<role>org.apache.maven.project.MavenProjectBuilder</role>
</requirement>
<requirement>
<role>org.apache.maven.plugin.PluginManager</role>
<role>org.apache.maven.plugin.MojoManager</role>
</requirement>
</requirements>
<configuration>

View File

@ -2,7 +2,7 @@
<component-discoverer-manager implementation="org.codehaus.plexus.component.discovery.DefaultComponentDiscovererManager">
<listeners>
<listener implementation="org.codehaus.plexus.component.discovery.DiscoveryListenerDescriptor">
<role>org.apache.maven.plugin.PluginManager</role>
<role>org.apache.maven.plugin.MojoManager</role>
</listener>
</listeners>
<component-discoverers>
@ -18,7 +18,7 @@
</component-factory-manager>
<components>
<component>
<role>org.apache.maven.plugin.PluginManager</role>
<role>org.apache.maven.plugin.MojoManager</role>
<implementation>org.apache.maven.plugin.DefaultPluginManager</implementation>
<requirements>
<requirement>

View File

@ -22,8 +22,8 @@ import org.apache.maven.monitor.logging.SystemStreamLog;
/**
* @version $Id$
*/
public abstract class AbstractPlugin
implements Plugin
public abstract class AbstractMojo
implements Mojo
{
private Log log;
@ -32,21 +32,21 @@ public abstract class AbstractPlugin
*
* @deprecated
*/
public void execute( PluginExecutionRequest request )
throws PluginExecutionException
public void execute( MojoExecutionRequest request )
throws MojoExecutionException
{
PluginExecutionResponse response = new PluginExecutionResponse();
MojoExecutionResponse response = new MojoExecutionResponse();
try
{
execute( request, response );
}
catch ( Exception e )
{
throw new PluginExecutionException( e.getMessage(), e );
throw new MojoExecutionException( e.getMessage(), e );
}
if ( response.isExecutionFailure() )
{
throw new PluginExecutionException( response.getFailureResponse().getSource(),
throw new MojoExecutionException( response.getFailureResponse().getSource(),
response.getFailureResponse().shortMessage(),
response.getFailureResponse().longMessage() );
}
@ -55,7 +55,7 @@ public abstract class AbstractPlugin
/**
* @deprecated
*/
public void execute( PluginExecutionRequest request, PluginExecutionResponse response )
public void execute( MojoExecutionRequest request, MojoExecutionResponse response )
throws Exception
{
throw new UnsupportedOperationException(
@ -81,9 +81,9 @@ public abstract class AbstractPlugin
}
public void execute()
throws PluginExecutionException
throws MojoExecutionException
{
throw new PluginExecutionException( "You must override execute() if you implement the new paradigm" );
throw new MojoExecutionException( "You must override execute() if you implement the new paradigm" );
}
}

View File

@ -22,16 +22,16 @@ import org.apache.maven.monitor.logging.Log;
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id$
*/
public interface Plugin
public interface Mojo
{
String ROLE = Plugin.class.getName();
String ROLE = Mojo.class.getName();
void execute()
throws PluginExecutionException;
throws MojoExecutionException;
/** @deprecated */
void execute( PluginExecutionRequest request )
throws PluginExecutionException;
void execute( MojoExecutionRequest request )
throws MojoExecutionException;
// TODO: not sure about this here, and may want a getLog on here as well/instead
void setLog( Log log );

View File

@ -22,25 +22,25 @@ package org.apache.maven.plugin;
* @author Brett Porter
* @version $Id$
*/
public class PluginExecutionException extends Exception
public class MojoExecutionException extends Exception
{
private Object source;
private String longMessage;
public PluginExecutionException( Object source, String shortMessage, String longMessage )
public MojoExecutionException( Object source, String shortMessage, String longMessage )
{
super( shortMessage );
this.source = source;
this.longMessage = longMessage;
}
public PluginExecutionException( String message, Exception cause )
public MojoExecutionException( String message, Exception cause )
{
super( message, cause );
}
public PluginExecutionException( String message )
public MojoExecutionException( String message )
{
super( message );
}

View File

@ -23,11 +23,11 @@ import java.util.Map;
* @version $Id$
* @deprecated
*/
public class PluginExecutionRequest
public class MojoExecutionRequest
{
private Map parameters;
public PluginExecutionRequest( Map parameters )
public MojoExecutionRequest( Map parameters )
{
this.parameters = parameters;
}

View File

@ -21,7 +21,7 @@ package org.apache.maven.plugin;
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id$
*/
public class PluginExecutionResponse
public class MojoExecutionResponse
{
private FailureResponse failureResponse = null;

View File

@ -110,7 +110,7 @@ public class JavaMojoDescriptorExtractor
}
// ----------------------------------------------------------------------
// Plugin descriptor creation from @tags
// Mojo descriptor creation from @tags
// ----------------------------------------------------------------------
private MojoDescriptor createMojoDescriptor( JavaSource javaSource, MavenProject project )

View File

@ -21,8 +21,8 @@ import org.apache.maven.artifact.resolver.filter.AndArtifactFilter;
import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter;
import org.apache.maven.artifact.resolver.filter.IncludesArtifactFilter;
import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
import org.apache.maven.plugin.AbstractPlugin;
import org.apache.maven.plugin.PluginExecutionException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.assembly.model.Assembly;
import org.apache.maven.plugins.assembly.model.DependencySet;
import org.apache.maven.plugins.assembly.model.FileSet;
@ -57,7 +57,7 @@ import java.util.jar.JarFile;
* @description assemble an application bundle or distribution
*/
public class AssemblyMojo
extends AbstractPlugin
extends AbstractMojo
{
private static final String[] EMPTY_STRING_ARRAY = {};
@ -106,7 +106,7 @@ public class AssemblyMojo
private File workDirectory;
public void execute()
throws PluginExecutionException
throws MojoExecutionException
{
try
{
@ -115,7 +115,7 @@ public class AssemblyMojo
catch ( Exception e )
{
// TODO: don't catch exception
throw new PluginExecutionException( "Error creating assembly", e );
throw new MojoExecutionException( "Error creating assembly", e );
}
}
@ -133,14 +133,14 @@ public class AssemblyMojo
InputStream resourceAsStream = getClass().getResourceAsStream( "/assemblies/" + descriptorId + ".xml" );
if ( resourceAsStream == null )
{
throw new PluginExecutionException( "Descriptor with ID '" + descriptorId + "' not found" );
throw new MojoExecutionException( "Descriptor with ID '" + descriptorId + "' not found" );
}
r = new InputStreamReader( resourceAsStream );
}
else
{
// TODO: better exception
throw new PluginExecutionException( "You must specify descriptor or descriptorId" );
throw new MojoExecutionException( "You must specify descriptor or descriptorId" );
}
try

View File

@ -16,8 +16,8 @@ package org.apache.maven.plugin.clean;
* limitations under the License.
*/
import org.apache.maven.plugin.AbstractPlugin;
import org.apache.maven.plugin.PluginExecutionException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import java.io.File;
@ -28,7 +28,7 @@ import java.io.File;
* @description Goal which cleans the build
*/
public class CleanPlugin
extends AbstractPlugin
extends AbstractMojo
{
private static final int DELETE_RETRY_SLEEP_MILLIS = 10;
@ -45,7 +45,7 @@ public class CleanPlugin
// private boolean failOnError;
public void execute()
throws PluginExecutionException
throws MojoExecutionException
{
if ( outputDirectory != null )
{

View File

@ -33,7 +33,7 @@ import java.util.List;
import java.util.Set;
public abstract class AbstractCompilerMojo
extends AbstractPlugin
extends AbstractMojo
{
private Compiler compiler = new JavacCompiler();
@ -79,7 +79,7 @@ public abstract class AbstractCompilerMojo
protected abstract String getOutputDirectory();
public void execute()
throws PluginExecutionException
throws MojoExecutionException
{
// ----------------------------------------------------------------------
//
@ -134,7 +134,7 @@ public abstract class AbstractCompilerMojo
catch ( Exception e )
{
// TODO: don't catch Exception
throw new PluginExecutionException( "Fatal error compiling", e );
throw new MojoExecutionException( "Fatal error compiling", e );
}
boolean compilationError = false;
@ -156,7 +156,7 @@ public abstract class AbstractCompilerMojo
}
private Set computeStaleSources()
throws PluginExecutionException
throws MojoExecutionException
{
long staleTime = 0;
@ -168,7 +168,7 @@ public abstract class AbstractCompilerMojo
}
catch ( NumberFormatException e )
{
throw new PluginExecutionException( "Invalid staleMillis plugin parameter value: \'" + staleMillis
throw new MojoExecutionException( "Invalid staleMillis plugin parameter value: \'" + staleMillis
+ "\'", e );
}
@ -195,7 +195,7 @@ public abstract class AbstractCompilerMojo
}
catch ( InclusionScanException e )
{
throw new PluginExecutionException( "Error scanning source root: \'" + sourceRoot
throw new MojoExecutionException( "Error scanning source root: \'" + sourceRoot
+ "\' for stale files to recompile.", e );
}
}

View File

@ -10,7 +10,7 @@ import java.util.List;
* @version $Id$
*/
public class CompilationFailureException
extends PluginExecutionException
extends MojoExecutionException
{
private static final String LS = System.getProperty( "line.separator" );

View File

@ -22,8 +22,8 @@ import org.apache.maven.artifact.deployer.ArtifactDeployer;
import org.apache.maven.artifact.deployer.ArtifactDeploymentException;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.plugin.AbstractPlugin;
import org.apache.maven.plugin.PluginExecutionException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.artifact.ProjectArtifactMetadata;
import java.io.File;
@ -36,7 +36,7 @@ import java.io.File;
* @description deploys an artifact to remote repository
*/
public class DeployMojo
extends AbstractPlugin
extends AbstractMojo
{
/**
@ -109,13 +109,13 @@ public class DeployMojo
private ArtifactRepository localRepository;
public void execute()
throws PluginExecutionException
throws MojoExecutionException
{
if ( deploymentRepository == null )
{
String msg = "Deployment failed: repository element was not specified in the pom inside"
+ " distributionManagement element";
throw new PluginExecutionException( msg );
throw new MojoExecutionException( msg );
}
// Deploy the POM
@ -142,7 +142,7 @@ public class DeployMojo
catch ( ArtifactDeploymentException e )
{
// TODO: deployment exception that does not give a trace
throw new PluginExecutionException( "Error deploying artifact", e );
throw new MojoExecutionException( "Error deploying artifact", e );
}
}
}

View File

@ -18,8 +18,8 @@ package org.apache.maven.plugin.ejb;
import org.apache.maven.archiver.MavenArchiveConfiguration;
import org.apache.maven.archiver.MavenArchiver;
import org.apache.maven.plugin.AbstractPlugin;
import org.apache.maven.plugin.PluginExecutionException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import java.io.File;
@ -32,7 +32,7 @@ import java.io.File;
* @description build an ejb
*/
public class EjbMojo
extends AbstractPlugin
extends AbstractMojo
{
// TODO: will null work instead?
private static final String[] DEFAULT_INCLUDES = new String[]{"**/**"};
@ -84,7 +84,7 @@ public class EjbMojo
* @todo Add license files in META-INF directory.
*/
public void execute()
throws PluginExecutionException
throws MojoExecutionException
{
getLog().info( "Building ejb " + jarName );
@ -126,7 +126,7 @@ public class EjbMojo
catch ( Exception e )
{
// TODO: improve error handling
throw new PluginExecutionException( "Error assembling EJB", e );
throw new MojoExecutionException( "Error assembling EJB", e );
}
}

View File

@ -18,8 +18,8 @@ package org.apache.maven.plugin.idea;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.model.Resource;
import org.apache.maven.plugin.AbstractPlugin;
import org.apache.maven.plugin.PluginExecutionException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.StringUtils;
@ -44,7 +44,7 @@ import java.util.Iterator;
* @todo use dom4j or something. Xpp3Dom can't cope properly with entities and so on
*/
public class IdeaMojo
extends AbstractPlugin
extends AbstractMojo
{
/**
* @parameter expression="${project}"
@ -54,7 +54,7 @@ public class IdeaMojo
private MavenProject project;
public void execute()
throws PluginExecutionException
throws MojoExecutionException
{
rewriteModule();
@ -64,7 +64,7 @@ public class IdeaMojo
}
private void rewriteWorkspace()
throws PluginExecutionException
throws MojoExecutionException
{
File workspaceFile = new File( project.getBasedir(), project.getArtifactId() + ".iws" );
if ( !workspaceFile.exists() )
@ -77,7 +77,7 @@ public class IdeaMojo
}
catch ( IOException e )
{
throw new PluginExecutionException( "Unable to create workspace file", e );
throw new MojoExecutionException( "Unable to create workspace file", e );
}
finally
{
@ -88,7 +88,7 @@ public class IdeaMojo
}
private void rewriteProject()
throws PluginExecutionException
throws MojoExecutionException
{
try
{
@ -148,16 +148,16 @@ public class IdeaMojo
}
catch ( XmlPullParserException e )
{
throw new PluginExecutionException( "Error parsing existing IML file", e );
throw new MojoExecutionException( "Error parsing existing IML file", e );
}
catch ( IOException e )
{
throw new PluginExecutionException( "Error parsing existing IML file", e );
throw new MojoExecutionException( "Error parsing existing IML file", e );
}
}
private void rewriteModule()
throws PluginExecutionException
throws MojoExecutionException
{
try
{
@ -262,11 +262,11 @@ public class IdeaMojo
}
catch ( XmlPullParserException e )
{
throw new PluginExecutionException( "Error parsing existing IML file", e );
throw new MojoExecutionException( "Error parsing existing IML file", e );
}
catch ( IOException e )
{
throw new PluginExecutionException( "Error parsing existing IML file", e );
throw new MojoExecutionException( "Error parsing existing IML file", e );
}
}

View File

@ -22,8 +22,8 @@ import org.apache.maven.artifact.installer.ArtifactInstallationException;
import org.apache.maven.artifact.installer.ArtifactInstaller;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.plugin.AbstractPlugin;
import org.apache.maven.plugin.PluginExecutionException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.artifact.ProjectArtifactMetadata;
import java.io.File;
@ -35,7 +35,7 @@ import java.io.File;
* @description installs project's main artifact in local repository
*/
public class InstallMojo
extends AbstractPlugin
extends AbstractMojo
{
/**
@ -101,7 +101,7 @@ public class InstallMojo
private ArtifactRepository localRepository;
public void execute()
throws PluginExecutionException
throws MojoExecutionException
{
Artifact artifact = new DefaultArtifact( groupId, artifactId, version, packaging );
@ -128,7 +128,7 @@ public class InstallMojo
catch ( ArtifactInstallationException e )
{
// TODO: install exception that does not give a trace
throw new PluginExecutionException( "Error installing artifact", e );
throw new MojoExecutionException( "Error installing artifact", e );
}
}
}

View File

@ -18,8 +18,8 @@ package org.apache.maven.plugin.jar;
import org.apache.maven.archiver.MavenArchiveConfiguration;
import org.apache.maven.archiver.MavenArchiver;
import org.apache.maven.plugin.AbstractPlugin;
import org.apache.maven.plugin.PluginExecutionException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import java.io.File;
@ -32,7 +32,7 @@ import java.io.File;
* @description build a jar
*/
public class JarMojo
extends AbstractPlugin
extends AbstractMojo
{
private static final String[] DEFAULT_EXCLUDES = new String[]{"**/package.html"};
@ -77,7 +77,7 @@ public class JarMojo
* @todo Add license files in META-INF directory.
*/
public void execute()
throws PluginExecutionException
throws MojoExecutionException
{
File jarFile = new File( basedir, finalName + ".jar" );
@ -102,7 +102,7 @@ public class JarMojo
catch ( Exception e )
{
// TODO: improve error handling
throw new PluginExecutionException( "Error assembling JAR", e );
throw new MojoExecutionException( "Error assembling JAR", e );
}
}

View File

@ -16,8 +16,8 @@ package org.apache.maven.plugin.plugin;
* limitations under the License.
*/
import org.apache.maven.plugin.AbstractPlugin;
import org.apache.maven.plugin.PluginExecutionException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.apache.maven.tools.plugin.scanner.MojoScanner;
@ -28,7 +28,7 @@ import java.util.Set;
* @version $Id$
*/
public abstract class AbstractGeneratorMojo
extends AbstractPlugin
extends AbstractMojo
{
/**
* @parameter expression="${project}"
@ -48,7 +48,7 @@ public abstract class AbstractGeneratorMojo
throws Exception;
public void execute()
throws PluginExecutionException
throws MojoExecutionException
{
try
{
@ -59,7 +59,7 @@ public abstract class AbstractGeneratorMojo
catch ( Exception e )
{
// TODO: improve error handling
throw new PluginExecutionException( "Error generating plugin descriptor", e );
throw new MojoExecutionException( "Error generating plugin descriptor", e );
}
}
}

View File

@ -17,8 +17,8 @@ package org.apache.maven.plugin.resources;
*/
import org.apache.maven.model.Resource;
import org.apache.maven.plugin.AbstractPlugin;
import org.apache.maven.plugin.PluginExecutionException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.StringUtils;
@ -41,7 +41,7 @@ import java.util.TreeMap;
* @description copy application resources
*/
public class ResourcesMojo
extends AbstractPlugin
extends AbstractMojo
{
/**
* The output directory into which to copy the resources.
@ -60,13 +60,13 @@ public class ResourcesMojo
private List resources;
public void execute()
throws PluginExecutionException
throws MojoExecutionException
{
copyResources( resources, outputDirectory );
}
protected void copyResources( List resources, String outputDirectory )
throws PluginExecutionException
throws MojoExecutionException
{
try
{
@ -89,7 +89,7 @@ public class ResourcesMojo
catch ( Exception e )
{
// TODO: handle exception
throw new PluginExecutionException( "Error copying resources", e );
throw new MojoExecutionException( "Error copying resources", e );
}
}

View File

@ -1,6 +1,6 @@
package org.apache.maven.plugin.resources;
import org.apache.maven.plugin.PluginExecutionException;
import org.apache.maven.plugin.MojoExecutionException;
import java.util.List;
@ -47,7 +47,7 @@ public class TestResourcesMojo
private List resources;
public void execute()
throws PluginExecutionException
throws MojoExecutionException
{
copyResources( resources, outputDirectory );
}

View File

@ -1,8 +1,8 @@
package org.apache.maven.doxia;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.plugin.AbstractPlugin;
import org.apache.maven.plugin.PluginExecutionException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.apache.maven.reporting.MavenReportConfiguration;
import org.apache.maven.reporting.manager.MavenReportManager;
@ -16,7 +16,7 @@ import java.util.List;
* @description Doxia plugin
*/
public class DoxiaMojo
extends AbstractPlugin
extends AbstractMojo
{
/**
* @parameter expression="${basedir}/src/site"
@ -77,7 +77,7 @@ public class DoxiaMojo
private List remoteRepositories;
public void execute()
throws PluginExecutionException
throws MojoExecutionException
{
try
{

View File

@ -4,8 +4,8 @@
package org.apache.maven.doxia;
import org.apache.maven.model.DistributionManagement;
import org.apache.maven.plugin.AbstractPlugin;
import org.apache.maven.plugin.PluginExecutionException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.apache.maven.wagon.ConnectionException;
import org.apache.maven.wagon.WagonUtils;
@ -35,7 +35,7 @@ import java.util.zip.ZipOutputStream;
* then making file by file copy.
*/
public class ScpSiteDeployMojo
extends AbstractPlugin
extends AbstractMojo
{
/**
* @parameter alias="siteDirectory" expression="${project.build.directory}/site"
@ -62,7 +62,7 @@ public class ScpSiteDeployMojo
private MavenProject project;
public void execute()
throws PluginExecutionException
throws MojoExecutionException
{
File baseDir = new File( inputDirectory );
@ -74,7 +74,7 @@ public class ScpSiteDeployMojo
}
catch ( IOException e )
{
throw new PluginExecutionException( "Cannot create site archive!", e );
throw new MojoExecutionException( "Cannot create site archive!", e );
}
SshCommandExecutor commandExecutor = new ScpWagon();
@ -89,7 +89,7 @@ public class ScpSiteDeployMojo
String msg = "distributionManagement element is missing in the POM: "
+ project.getId();
throw new PluginExecutionException( msg );
throw new MojoExecutionException( msg );
}
@ -98,7 +98,7 @@ public class ScpSiteDeployMojo
String msg = "distributionManagement/repository element is missing in the POM: "
+ project.getId();
throw new PluginExecutionException( msg );
throw new MojoExecutionException( msg );
}
@ -111,7 +111,7 @@ public class ScpSiteDeployMojo
String msg = "distributionManagement/site/url element is missing in the POM: "
+ project.getId();
throw new PluginExecutionException( msg );
throw new MojoExecutionException( msg );
}
@ -149,7 +149,7 @@ public class ScpSiteDeployMojo
}
catch( Exception e )
{
throw new PluginExecutionException( "Error transfering site archive!", e );
throw new MojoExecutionException( "Error transfering site archive!", e );
}
finally
{

View File

@ -19,8 +19,8 @@ package org.apache.maven.test;
import org.apache.maven.artifact.DefaultArtifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactPathFormatException;
import org.apache.maven.plugin.AbstractPlugin;
import org.apache.maven.plugin.PluginExecutionException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.codehaus.surefire.SurefireBooter;
import java.io.File;
@ -38,7 +38,7 @@ import java.util.StringTokenizer;
* @todo make report to be produced configurable
*/
public class SurefirePlugin
extends AbstractPlugin
extends AbstractMojo
{
/**
@ -98,7 +98,7 @@ public class SurefirePlugin
private ArtifactRepository localRepository;
public void execute()
throws PluginExecutionException
throws MojoExecutionException
{
// ----------------------------------------------------------------------
// Setup the surefire booter
@ -169,7 +169,7 @@ public class SurefirePlugin
}
catch ( ArtifactPathFormatException e )
{
throw new PluginExecutionException( "Error finding surefire JAR", e );
throw new MojoExecutionException( "Error finding surefire JAR", e );
}
surefireBooter.addClassPathUrl( new File( classesDirectory ).getPath() );
@ -193,12 +193,12 @@ public class SurefirePlugin
catch ( Exception e )
{
// TODO: better handling
throw new PluginExecutionException( "Error executing surefire", e );
throw new MojoExecutionException( "Error executing surefire", e );
}
if ( !success )
{
throw new PluginExecutionException( "There are some test failures." );
throw new MojoExecutionException( "There are some test failures." );
}
}

View File

@ -20,8 +20,8 @@ import org.apache.maven.archiver.MavenArchiveConfiguration;
import org.apache.maven.archiver.MavenArchiver;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.DependencyResolutionRequiredException;
import org.apache.maven.plugin.AbstractPlugin;
import org.apache.maven.plugin.PluginExecutionException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.archiver.ArchiverException;
import org.codehaus.plexus.archiver.jar.ManifestException;
@ -43,7 +43,7 @@ import java.util.Set;
* @description build a war/webapp
*/
public class WarMojo
extends AbstractPlugin
extends AbstractMojo
{
public static final String WEB_INF = "WEB-INF";
@ -203,7 +203,7 @@ public class WarMojo
}
public void execute()
throws PluginExecutionException
throws MojoExecutionException
{
File warFile = new File( outputDirectory, warName + ".war" );
@ -214,7 +214,7 @@ public class WarMojo
catch ( Exception e )
{
// TODO: improve error handling
throw new PluginExecutionException( "Error assembling WAR", e );
throw new MojoExecutionException( "Error assembling WAR", e );
}
}

View File

@ -709,7 +709,7 @@ public class MavenProject
Xpp3Dom dom = null;
// ----------------------------------------------------------------------
// I would like to be able to lookup the Plugin object using a key but
// I would like to be able to lookup the Mojo object using a key but
// we have a limitation in modello that will be remedied shortly. So
// for now I have to iterate through and see what we have.
// ----------------------------------------------------------------------

View File

@ -151,7 +151,7 @@ public class DefaultModelInheritanceAssembler
}
}
// Plugin Repositories :: aggregate
// Mojo Repositories :: aggregate
List parentPluginRepositories = parent.getPluginRepositories();
List childPluginRepositories = child.getPluginRepositories();