jvanzyl     2002/12/11 14:30:07

  Modified:    src/java/org/apache/maven Maven.java MavenUtils.java
               src/java/org/apache/maven/cli App.java
               src/plugins-build/plexus plugin.jelly
  Log:
  o Maven will now execute when a project.xml file is not present, or more
    accurately when the maven bean has not been handed a live project instance.
    We can now create plugins that generate various maven projects.
  
  Revision  Changes    Path
  1.12      +12 -11    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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Maven.java        10 Dec 2002 03:09:43 -0000      1.11
  +++ Maven.java        11 Dec 2002 22:30:07 -0000      1.12
  @@ -108,9 +108,6 @@
       /** Filename of project-specific maven buildfile. */
       public static final String PROJECT_BUILD_FILE_NAME = "maven.xml";
   
  -    /** 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";
   
  @@ -232,8 +229,13 @@
           initializeAnt();
           initializeJelly();
           initializeDriver();
  -        initializeDependencyClasspath();
  -        initializeProjectVerifier();
  +
  +        if ( getContext().getProject() != null )
  +        {
  +            initializeDependencyClasspath();
  +            initializeProjectVerifier();
  +        }
  +
           initializePlugins();
   
           loadProjectBuildFile();
  @@ -375,7 +377,10 @@
       public void verifyProject()
           throws RepoConfigException, UnsatisfiedDependencyException
       {
  -        getContext().getProjectVerifier().verify();
  +        if ( getContext().getProject() != null )
  +        {
  +            getContext().getProjectVerifier().verify();
  +        }
       }
   
       /** Run maven.
  @@ -441,10 +446,6 @@
               if ( defaultGoalName != null )
               {
                   goalNames.add( defaultGoalName );
  -            }
  -            else
  -            {
  -                goalNames.add( getContext().getVariable( DEFAULT_GOAL ) );
               }
           }
   
  
  
  
  1.76      +2 -1      jakarta-turbine-maven/src/java/org/apache/maven/MavenUtils.java
  
  Index: MavenUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/MavenUtils.java,v
  retrieving revision 1.75
  retrieving revision 1.76
  diff -u -r1.75 -r1.76
  --- MavenUtils.java   10 Dec 2002 23:03:04 -0000      1.75
  +++ MavenUtils.java   11 Dec 2002 22:30:07 -0000      1.76
  @@ -828,6 +828,7 @@
       /**
        * Load Maven user messages from a resource bundle given the
        * user's locale.
  +     * @todo Move locale tools into their own class.
        */
       private static void loadMessages()
       {
  
  
  
  1.13      +12 -7     jakarta-turbine-maven/src/java/org/apache/maven/cli/App.java
  
  Index: App.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/cli/App.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- App.java  10 Dec 2002 03:14:13 -0000      1.12
  +++ App.java  11 Dec 2002 22:30:07 -0000      1.13
  @@ -357,14 +357,19 @@
       private void initializeProject()
           throws Exception
       {
  -        if ( getContext().getDescriptorFile().length() == 0 )
  +        File descriptorFile = getContext().getDescriptorFile();
  +
  +        if ( descriptorFile.exists() )
           {
  -            throw new Exception( "The " + getContext().getDescriptorFile().getName()
  -                                 + " file you specified has a length of zero." );
  -        }
  +            if ( descriptorFile.length() == 0 )
  +            {
  +                throw new Exception( "The " + 
getContext().getDescriptorFile().getName()
  +                                     + " file you specified has a length of zero." 
);
  +            }
   
  -        getContext().setProject( MavenUtils.getProject( 
getContext().getDescriptorFile(),
  -                                                        
getContext().getDescriptorDirectory() ) );
  +            getContext().setProject( MavenUtils.getProject( 
getContext().getDescriptorFile(),
  +                                                            
getContext().getDescriptorDirectory() ) );
  +        }
       }
   
       /**
  
  
  
  1.4       +1 -1      jakarta-turbine-maven/src/plugins-build/plexus/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/plexus/plugin.jelly,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- plugin.jelly      30 Nov 2002 00:59:49 -0000      1.3
  +++ plugin.jelly      11 Dec 2002 22:30:07 -0000      1.4
  @@ -1,9 +1,9 @@
   <project 
     xmlns:j="jelly:core" 
  +  xmlns:maven="jelly:maven">
     xmlns:texen="texen"
     xmlns:reactor="reactor"
     xmlns:deploy="deploy"
  -  xmlns:maven="jelly:org.apache.maven.jelly.tags.project.MavenTagLibrary">
   
     <!-- ===================================================================== -->
     <!-- D E P L O Y  P L E X U S                                              -->
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to