Return-Path: Delivered-To: apmail-maven-m2-dev-archive@www.apache.org Received: (qmail 95242 invoked from network); 17 Jun 2004 22:51:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 17 Jun 2004 22:51:14 -0000 Received: (qmail 6989 invoked by uid 500); 17 Jun 2004 22:51:38 -0000 Delivered-To: apmail-maven-m2-dev-archive@maven.apache.org Received: (qmail 6957 invoked by uid 500); 17 Jun 2004 22:51:37 -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 6919 invoked by uid 99); 17 Jun 2004 22:51:36 -0000 Received: from [195.46.220.209] (HELO mx.noos.fr) (195.46.220.209) by apache.org (qpsmtpd/0.27.1) with ESMTP; Thu, 17 Jun 2004 15:51:36 -0700 Received: from noos.fr (pm-mnet5.mgn.net [195.46.220.216]) by mx.noos.fr (Postfix) with SMTP id A24462743A for ; Fri, 18 Jun 2004 00:51:01 +0200 (MEST) X-Mailbox-Line: From jerome@coffeebreaks.org Fri Jun 18 00:50:58 2004 Received: from m138.net81-64-87.noos.fr (m138.net81-64-87.noos.fr [81.64.87.138]) by pm-mnet5.mgn.net with ESMTP; Fri, 18 Jun 2004 00:50:58 (MEST) Subject: Re: cvs commit: maven-components/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin CompilerMojo.java TestCompilerMojo.java From: Jerome Lacoste To: Maven 2 Developers List In-Reply-To: <20040614150457.91631.qmail@minotaur.apache.org> References: <20040614150457.91631.qmail@minotaur.apache.org> Content-Type: text/plain Message-Id: <1087491032.6376.17.camel@expresso> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Thu, 17 Jun 2004 18:50:33 +0200 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Mon, 2004-06-14 at 17:04, jvanzyl@apache.org wrote: > jvanzyl 2004/06/14 08:04:57 > > Added: maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin > CompilerMojo.java TestCompilerMojo.java > Log: > > > Revision Changes Path > 1.1 maven-components/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerMojo.java > > Index: CompilerMojo.java > =================================================================== > package org.apache.maven.plugin; > > import org.codehaus.plexus.compiler.Compiler; > import org.codehaus.plexus.compiler.CompilerError; > import org.codehaus.plexus.compiler.javac.JavacCompiler; > > import java.io.File; > import java.util.Iterator; > import java.util.List; > > /** > * @goal compile > * > * @description Compiles application sources > * > * @parameter > * name="sourceDirectory" > * type="String" > * required="true" > * validator="" > * expression="#project.build.sourceDirectory" > * description="" > * @parameter > * name="outputDirectory" > * type="String" > * required="true" > * validator="" > * expression="#project.build.directory/classes" > * description="" > * @parameter > * name="classpathElements" > * type="String[]" > * required="true" > * validator="" > * expression="#project.classpathElements" > * description="" > * > * @author Jason van Zyl > * @version $Id: CompilerMojo.java,v 1.1 2004/06/14 15:04:57 jvanzyl Exp $ > * @todo use compile source roots and not the pom.build.sourceDirectory so that any > * sort of preprocessing and/or source generation can be taken into consideration. > */ > > public class CompilerMojo > extends AbstractPlugin > { > private Compiler compiler = new JavacCompiler(); > > private boolean debug = false; > > public void execute( PluginExecutionRequest request, PluginExecutionResponse response ) > throws Exception > { > // ---------------------------------------------------------------------- > // > // ---------------------------------------------------------------------- > > String sourceDirectory = (String) request.getParameter( "sourceDirectory" ); > > String outputDirectory = (String) request.getParameter( "outputDirectory" ); > > String[] classpathElements = (String[]) request.getParameter( "classpathElements" ); > > String compilerId = (String) request.getParameter( "compiler" ); > > // ---------------------------------------------------------------------- > // > // ---------------------------------------------------------------------- > > if ( ! new File( sourceDirectory ).exists() ) > { > return; > } > > List messages = compiler.compile( classpathElements, new String[]{sourceDirectory}, outputDirectory ); > > if ( debug ) > { > for ( int i = 0; i < classpathElements.length; i++ ) > { > String message; > > if ( new File( classpathElements[i] ).exists() ) > { > message = "present in repository."; > } > else > { > message = "Warning! not present in repository!"; > } > > System.out.println( "classpathElements[ "+ i +" ] = " + classpathElements[i] + ": " + message ); what is the status on login? Is System.out to be the preferred mecanism? Or will a logging framework be involved at some point? Jerome