Return-Path: Delivered-To: apmail-maven-m2-dev-archive@www.apache.org Received: (qmail 52020 invoked from network); 20 Jun 2004 02:00:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 20 Jun 2004 02:00:44 -0000 Received: (qmail 51817 invoked by uid 500); 20 Jun 2004 02:00:47 -0000 Delivered-To: apmail-maven-m2-dev-archive@maven.apache.org Received: (qmail 51780 invoked by uid 500); 20 Jun 2004 02:00:43 -0000 Mailing-List: contact m2-dev-help@maven.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: List-Id: "Maven 2 Developers List" Reply-To: "Maven 2 Developers List" Delivered-To: mailing list m2-dev@maven.apache.org Received: (qmail 51751 invoked by uid 500); 20 Jun 2004 02:00:42 -0000 Delivered-To: apmail-maven-components-cvs@apache.org Received: (qmail 51584 invoked by uid 99); 20 Jun 2004 02:00:41 -0000 Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.27.1) with SMTP; Sat, 19 Jun 2004 19:00:41 -0700 Received: (qmail 51893 invoked by uid 1162); 20 Jun 2004 02:00:34 -0000 Date: 20 Jun 2004 02:00:34 -0000 Message-ID: <20040620020034.51892.qmail@minotaur.apache.org> From: jvanzyl@apache.org To: maven-components-cvs@apache.org Subject: cvs commit: maven-components/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin CompilationFailureResponse.java CompilerMojo.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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 @@ plexus - plexus-compiler - 1.0-SNAPSHOT + plexus-compiler-api + 1.0 + + + plexus + plexus-compiler-javac + 1.0 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 Jason van Zyl * @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(); } }