Return-Path: Mailing-List: contact turbine-maven-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list turbine-maven-dev@jakarta.apache.org Received: (qmail 26390 invoked by uid 97); 7 Dec 2002 23:14:01 -0000 Received: (qmail 26386 invoked by uid 98); 7 Dec 2002 23:14:01 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 26367 invoked from network); 7 Dec 2002 23:13:59 -0000 Received: from daedalus.apache.org (HELO apache.org) (63.251.56.142) by nagoya.betaversion.org with SMTP; 7 Dec 2002 23:13:59 -0000 Received: (qmail 38800 invoked by uid 500); 7 Dec 2002 23:12:47 -0000 Received: (qmail 38793 invoked from network); 7 Dec 2002 23:12:46 -0000 Received: from icarus.apache.org (63.251.56.143) by daedalus.apache.org with SMTP; 7 Dec 2002 23:12:46 -0000 Received: (qmail 73111 invoked by uid 1162); 7 Dec 2002 23:12:46 -0000 Date: 7 Dec 2002 23:12:46 -0000 Message-ID: <20021207231246.73110.qmail@icarus.apache.org> From: jvanzyl@apache.org To: jakarta-turbine-maven-cvs@apache.org Subject: cvs commit: jakarta-turbine-maven/src/java/org/apache/maven Maven.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N jvanzyl 2002/12/07 15:12:46 Modified: src/java/org/apache/maven Maven.java Log: o Fixing bug where the default goal was not being added correctly. Revision Changes Path 1.9 +18 -4 jakarta-turbine-maven/src/java/org/apache/maven/Maven.java Index: Maven.java =================================================================== RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/Maven.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Maven.java 6 Dec 2002 16:32:25 -0000 1.8 +++ Maven.java 7 Dec 2002 23:12:46 -0000 1.9 @@ -109,6 +109,12 @@ /** Tag for default goal */ public static final String DEFAULT_GOAL = "maven.default.goal"; + /** Tag for build start goal. */ + public static final String BUILD_START_GOAL = "build:start"; + + /** Tag for build end goal. */ + public static final String BUILD_END_GOAL = "build:end"; + /** Initialization jellyscript name. */ public static final String DRIVER_SCRIPT_NAME = "driver.jelly"; @@ -140,6 +146,7 @@ public Maven() { this.goalNames = new ArrayList( 3 ); + goalNames.add( BUILD_START_GOAL ); } // ------------------------------------------------------------ @@ -419,7 +426,12 @@ private void runGoals( List goalNames ) throws UnknownGoalException, Exception { - if ( goalNames.isEmpty() ) + // There will always be at least one goal present which is the build:start + // goal. If this is the only goal present then we want to add either the + // default goal specified in the project.xml file, or the default goal + // specified in the driver.properties file. + + if ( goalNames.size() == 1 ) { String defaultGoalName = getContext().getWerkzProject().getDefaultGoalName(); @@ -433,17 +445,19 @@ } } + goalNames.add( BUILD_END_GOAL ); + for ( Iterator i = goalNames.iterator(); i.hasNext(); ) { String eachGoalName = (String) i.next(); getContext().getPluginManager().prepForGoal( eachGoalName ); - com.werken.werkz.Goal eachGoal = getContext().getWerkzProject().getGoal( eachGoalName ); + Goal eachGoal = getContext().getWerkzProject().getGoal( eachGoalName ); if ( eachGoal == null ) { - throw new org.apache.maven.UnknownGoalException( eachGoalName ); + throw new UnknownGoalException( eachGoalName ); } }