maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject cvs commit: maven-components/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin PluginFailureResponse.java PluginInstallMojo.java
Date Sun, 05 Sep 2004 19:03:41 GMT
evenisse    2004/09/05 12:03:41

  Modified:    maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin
                        PluginInstallMojo.java
  Added:       maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin
                        PluginFailureResponse.java
  Log:
  Add failure if artifact isn't a plugin.
  
  Revision  Changes    Path
  1.6       +7 -0      maven-components/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginInstallMojo.java
  
  Index: PluginInstallMojo.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginInstallMojo.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PluginInstallMojo.java	23 Aug 2004 00:33:09 -0000	1.5
  +++ PluginInstallMojo.java	5 Sep 2004 19:03:41 -0000	1.6
  @@ -50,6 +50,13 @@
   
           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(),
                                                    project.getArtifactId(),
                                                    project.getVersion(),
  
  
  
  1.1                  maven-components/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginFailureResponse.java
  
  Index: PluginFailureResponse.java
  ===================================================================
  package org.apache.maven.plugin.plugin;
  
  import org.apache.maven.plugin.FailureResponse;
  
  /**
   * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
   * @version $Id: PluginFailureResponse.java,v 1.1 2004/09/05 19:03:41 evenisse Exp $
   */
  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();
      }
  }
  
  
  

Mime
View raw message