maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject cvs commit: jakarta-turbine-maven/src/java/org/apache/maven Maven.java
Date Sat, 07 Dec 2002 23:12:46 GMT
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 );
               }
           }
   
  
  
  

Mime
View raw message