You are viewing a plain text version of this content. The canonical link for it is here.
Posted to m2-dev@maven.apache.org by jv...@apache.org on 2004/06/20 03:59:40 UTC

cvs commit: maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/generator InvalidParameterException.java AbstractGenerator.java PluginDescriptorGenerator.java

jvanzyl     2004/06/19 18:59:40

  Modified:    maven-plugin/src/main/java/org/apache/maven/plugin
                        PluginExecutionResponse.java
               maven-plugin/src/main/java/org/apache/maven/plugin/generator
                        AbstractGenerator.java
                        PluginDescriptorGenerator.java
  Added:       maven-plugin/src/main/java/org/apache/maven/plugin
                        FailureResponse.java
               maven-plugin/src/main/java/org/apache/maven/plugin/generator
                        InvalidParameterException.java
  Removed:     maven-plugin/src/main/java/org/apache/maven/plugin
                        InvalidParameterException.java
                        PluginConfigurationException.java
  Log:
  o providing facilities to trap failures and push them back into the client
    code.
  
  Revision  Changes    Path
  1.2       +12 -8     maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/PluginExecutionResponse.java
  
  Index: PluginExecutionResponse.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/PluginExecutionResponse.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PluginExecutionResponse.java	16 May 2004 04:25:16 -0000	1.1
  +++ PluginExecutionResponse.java	20 Jun 2004 01:59:40 -0000	1.2
  @@ -22,20 +22,24 @@
    */
   public class PluginExecutionResponse
   {
  -    private Throwable exception;
  +    private boolean executionFailure;
   
  -    public Throwable getException()
  +    private FailureResponse failureResponse;
  +
  +    public boolean isExecutionFailure()
       {
  -        return exception;
  +        return executionFailure;
       }
   
  -    public void setException( Throwable exception )
  +    public void setExecutionFailure( boolean executionFailure, FailureResponse failureResponse )
       {
  -        this.exception = exception;
  +        this.executionFailure = executionFailure;
  +
  +        this.failureResponse = failureResponse;
       }
   
  -    public boolean exceptionOccurred()
  +    public FailureResponse getFailureResponse()
       {
  -        return ( exception != null );
  +        return failureResponse;
       }
   }
  
  
  
  1.1                  maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/FailureResponse.java
  
  Index: FailureResponse.java
  ===================================================================
  package org.apache.maven.plugin;
  
  /**
   * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
   * @version $Id: FailureResponse.java,v 1.1 2004/06/20 01:59:40 jvanzyl Exp $
   */
  public abstract class FailureResponse
  {
      protected Object source;
  
      protected FailureResponse( Object source )
      {
          this.source = source;
      }
  
      public abstract String shortMessage();
  
      public abstract String longMessage();
  }
  
  
  
  1.15      +0 -1      maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/generator/AbstractGenerator.java
  
  Index: AbstractGenerator.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/generator/AbstractGenerator.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- AbstractGenerator.java	16 Jun 2004 17:45:51 -0000	1.14
  +++ AbstractGenerator.java	20 Jun 2004 01:59:40 -0000	1.15
  @@ -6,7 +6,6 @@
   import com.thoughtworks.qdox.model.JavaSource;
   import com.thoughtworks.xstream.xml.xpp3.Xpp3Dom;
   import com.thoughtworks.xstream.xml.xpp3.Xpp3DomBuilder;
  -import org.apache.maven.plugin.InvalidParameterException;
   import org.apache.maven.plugin.descriptor.Goal;
   import org.apache.maven.plugin.descriptor.MojoDescriptor;
   import org.apache.maven.plugin.descriptor.Parameter;
  
  
  
  1.15      +0 -1      maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/generator/PluginDescriptorGenerator.java
  
  Index: PluginDescriptorGenerator.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/generator/PluginDescriptorGenerator.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- PluginDescriptorGenerator.java	17 Jun 2004 20:43:59 -0000	1.14
  +++ PluginDescriptorGenerator.java	20 Jun 2004 01:59:40 -0000	1.15
  @@ -6,7 +6,6 @@
   import org.apache.maven.plugin.descriptor.Goal;
   import org.apache.maven.plugin.descriptor.Parameter;
   import org.apache.maven.plugin.descriptor.MojoDescriptor;
  -import org.apache.maven.plugin.InvalidParameterException;
   
   import java.io.File;
   import java.io.FileWriter;
  
  
  
  1.1                  maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/generator/InvalidParameterException.java
  
  Index: InvalidParameterException.java
  ===================================================================
  package org.apache.maven.plugin.generator;
  
  /**
   * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
   * @version $Id: InvalidParameterException.java,v 1.1 2004/06/20 01:59:40 jvanzyl Exp $
   */
  public class InvalidParameterException
      extends Exception
  {
      public InvalidParameterException()
      {
      }
  
      public InvalidParameterException( String element, int i )
      {
          super( "The " + element + " element in parameter # " + i + " is invalid. It cannot be null." );
      }
  
      public InvalidParameterException( Throwable cause )
      {
          super( cause );
      }
  
      public InvalidParameterException( String message, Throwable cause )
      {
          super( message, cause );
      }
  }