mirror of https://github.com/apache/maven.git
Add failure if artifact isn't a plugin.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163031 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2b4a352630
commit
d4125cbafc
|
@ -0,0 +1,30 @@
|
||||||
|
package org.apache.maven.plugin.plugin;
|
||||||
|
|
||||||
|
import org.apache.maven.plugin.FailureResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
public class PluginFailureResponse
|
||||||
|
extends FailureResponse
|
||||||
|
{
|
||||||
|
private String LS = System.getProperty( "line.separator" );
|
||||||
|
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
public PluginFailureResponse( Object o )
|
||||||
|
{
|
||||||
|
super( o );
|
||||||
|
}
|
||||||
|
|
||||||
|
public String shortMessage()
|
||||||
|
{
|
||||||
|
return (String) source;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String longMessage()
|
||||||
|
{
|
||||||
|
return shortMessage();
|
||||||
|
}
|
||||||
|
}
|
|
@ -50,6 +50,13 @@ public class PluginInstallMojo
|
||||||
|
|
||||||
ArtifactRepository localRepository = (ArtifactRepository) request.getParameter( "localRepository" );
|
ArtifactRepository localRepository = (ArtifactRepository) request.getParameter( "localRepository" );
|
||||||
|
|
||||||
|
if ( ! "plugin".equals( project.getType() ) )
|
||||||
|
{
|
||||||
|
response.setExecutionFailure( true, new PluginFailureResponse( "This project isn't a plugin." ) );
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Artifact artifact = new DefaultArtifact( project.getGroupId(),
|
Artifact artifact = new DefaultArtifact( project.getGroupId(),
|
||||||
project.getArtifactId(),
|
project.getArtifactId(),
|
||||||
project.getVersion(),
|
project.getVersion(),
|
||||||
|
|
Loading…
Reference in New Issue