maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject cvs commit: maven-components/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin CompilationFailureResponse.java CompilerMojo.java
Date Sun, 20 Jun 2004 02:00:34 GMT
jvanzyl     2004/06/19 19:00:34

  Modified:    maven-plugins/maven-compiler-plugin pom.xml
               maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin
                        CompilerMojo.java
  Added:       maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin
                        CompilationFailureResponse.java
  Log:
  o first plugin to send info back to the client code for reporting to
    the user.
  
  Revision  Changes    Path
  1.2       +7 -2      maven-components/maven-plugins/maven-compiler-plugin/pom.xml
  
  Index: pom.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-compiler-plugin/pom.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- pom.xml	9 Jun 2004 03:10:50 -0000	1.1
  +++ pom.xml	20 Jun 2004 02:00:34 -0000	1.2
  @@ -15,8 +15,13 @@
     <dependencies>
       <dependency>
         <groupId>plexus</groupId>
  -      <artifactId>plexus-compiler</artifactId>
  -      <version>1.0-SNAPSHOT</version>
  +      <artifactId>plexus-compiler-api</artifactId>
  +      <version>1.0</version>
  +    </dependency>
  +    <dependency>
  +      <groupId>plexus</groupId>
  +      <artifactId>plexus-compiler-javac</artifactId>
  +      <version>1.0</version>
       </dependency>
     </dependencies>
   </project>
  
  
  
  1.7       +2 -4      maven-components/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerMojo.java
  
  Index: CompilerMojo.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerMojo.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- CompilerMojo.java	16 Jun 2004 19:12:26 -0000	1.6
  +++ CompilerMojo.java	20 Jun 2004 02:00:34 -0000	1.7
  @@ -103,13 +103,11 @@
               {
                   compilationError = true;
               }
  -
  -            System.out.println( message.getMessage() );
           }
   
           if ( compilationError )
           {
  -            throw new Exception( "Compilation failure!" );
  +            response.setExecutionFailure( true, new CompilationFailureResponse( messages
) );
           }
       }
   }
  
  
  
  1.1                  maven-components/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilationFailureResponse.java
  
  Index: CompilationFailureResponse.java
  ===================================================================
  package org.apache.maven.plugin;
  
  import org.codehaus.plexus.compiler.CompilerError;
  
  import java.util.List;
  import java.util.Iterator;
  
  /**
   * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
   * @version $Id: CompilationFailureResponse.java,v 1.1 2004/06/20 02:00:34 jvanzyl Exp $
   */
  public class CompilationFailureResponse
      extends FailureResponse
  {
      public CompilationFailureResponse( Object o )
      {
          super( o );
      }
  
      public String shortMessage()
      {
          return "Compilation failure";
      }
  
      public String longMessage()
      {
          StringBuffer sb = new StringBuffer();
  
          List messages = (List)source;
  
          for ( Iterator it = messages.iterator(); it.hasNext() ; )
          {
              CompilerError compilerError = (CompilerError) it.next();
  
              sb.append( compilerError );
          }
  
          return sb.toString();
      }
  }
  
  
  

Mime
View raw message