evenisse    2004/01/26 03:49:56

  Modified:    maven-core/src/java/org/apache/maven Maven.java
                        MavenUtils.java
               maven-core/src/java/org/apache/maven/jelly/tags
                        BaseTagSupport.java
               maven-core/src/java/org/apache/maven/jelly/tags/maven
                        PomTag.java ReactorTag.java
               maven-core/src/java/org/apache/maven/plugin
                        MavenClasspathBuilder.java PluginManager.java
               maven-core/src/java/org/apache/maven/verifier
                        DependencyVerifier.java LocalSettingsVerifier.java
  Added:       maven-core/src/java/org/apache/maven/jelly/tags
                        MavenTagSupport.java
  Log:
  - Use MavenProject instead of Project
  - Use MavenProjectBuilder instead of ProjectBuilder
  - Use MavenUtils instead of MavenStaticUtils
  
  Revision  Changes    Path
  1.3       +10 -10    maven-components/maven-core/src/java/org/apache/maven/Maven.java
  
  Index: Maven.java
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-core/src/java/org/apache/maven/Maven.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Maven.java        25 Jan 2004 00:29:10 -0000      1.2
  +++ Maven.java        26 Jan 2004 11:49:56 -0000      1.3
  @@ -115,7 +115,7 @@
       private Map properties;
   
       /** Maven Utils for building projects. */
  -    private MavenStaticUtils mavenUtils;
  +    private MavenUtils mavenUtils;
   
       // ------------------------------------------------------------
       // C O N S T R U C T O R S
  @@ -125,7 +125,7 @@
       public Maven()
           throws Exception
       {
  -        mavenUtils = new MavenStaticUtils();
  +        mavenUtils = new MavenUtils();
   
           pluginManager = new PluginManager( this );
   
  @@ -229,7 +229,7 @@
           {
               if ( project.length() == 0 )
               {
  -                throw new Exception( MavenStaticUtils.getMessage( 
"empty.descriptor.error",
  +                throw new Exception( MavenUtils.getMessage( 
"empty.descriptor.error",
                                                               project.getName() ) );
               }
           }
  @@ -291,14 +291,14 @@
           Properties systemProperties = System.getProperties();
   
           File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), 
"build.properties" );
  -        Properties userBuildProperties = MavenStaticUtils.loadProperties( 
userBuildPropertiesFile );
  +        Properties userBuildProperties = MavenUtils.loadProperties( 
userBuildPropertiesFile );
   
  -        Properties driverProperties = MavenStaticUtils.loadProperties(
  -            MavenStaticUtils.class.getClassLoader().getResourceAsStream(
  +        Properties driverProperties = MavenUtils.loadProperties(
  +            MavenUtils.class.getClassLoader().getResourceAsStream(
                   MavenConstants.DRIVER_PROPERTIES ) );
   
  -        Properties defaultProperties = MavenStaticUtils.loadProperties(
  -            MavenStaticUtils.class.getClassLoader().getResourceAsStream(
  +        Properties defaultProperties = MavenUtils.loadProperties(
  +            MavenUtils.class.getClassLoader().getResourceAsStream(
                   MavenConstants.DEFAULTS_PROPERTIES ) );
   
           Map result = CollectionUtils.mergeMaps( new Map[]
  @@ -330,7 +330,7 @@
       public List getProjects( File directory, String includes, String excludes )
           throws Exception
       {
  -        return MavenStaticUtils.getProjects( directory, includes, excludes );
  +        return MavenUtils.getProjects( directory, includes, excludes );
       }
   
       public MavenProject getProject( File project )
  
  
  
  1.2       +8 -8      
maven-components/maven-core/src/java/org/apache/maven/MavenUtils.java
  
  Index: MavenUtils.java
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-core/src/java/org/apache/maven/MavenUtils.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MavenUtils.java   8 Jan 2004 04:29:11 -0000       1.1
  +++ MavenUtils.java   26 Jan 2004 11:49:56 -0000      1.2
  @@ -57,8 +57,8 @@
    */
   
   import com.werken.forehead.Forehead;
  -import org.apache.maven.project.Project;
  -import org.apache.maven.project.ProjectBuilder;
  +import org.apache.maven.project.MavenProject;
  +import org.apache.maven.project.MavenProjectBuilder;
   import org.codehaus.plexus.embed.Embedder;
   import org.codehaus.plexus.util.DirectoryScanner;
   import org.codehaus.plexus.util.StringUtils;
  @@ -87,9 +87,9 @@
    */
   public class MavenUtils
   {
  -    private static ProjectBuilder projectBuilder;
  +    private static MavenProjectBuilder projectBuilder;
   
  -    private static ProjectBuilder getProjectBuilder()
  +    private static MavenProjectBuilder getProjectBuilder()
       {
           if ( projectBuilder == null )
           {
  @@ -107,7 +107,7 @@
               {
                   embedder.start();
   
  -                projectBuilder = (ProjectBuilder) embedder.lookup( 
ProjectBuilder.ROLE );
  +                projectBuilder = (MavenProjectBuilder) embedder.lookup( 
MavenProjectBuilder.ROLE );
               }
               catch ( Exception e )
               {
  @@ -118,13 +118,13 @@
           return projectBuilder;
       }
   
  -    public static Project getProject( File project )
  +    public static MavenProject getProject( File project )
           throws Exception
       {
           return getProjectBuilder().build( project );
       }
   
  -    public static Project getProject( File project, boolean useParent )
  +    public static MavenProject getProject( File project, boolean useParent )
           throws Exception
       {
           return getProjectBuilder().build( project, useParent );
  
  
  
  1.2       +5 -0      
maven-components/maven-core/src/java/org/apache/maven/jelly/tags/BaseTagSupport.java
  
  Index: BaseTagSupport.java
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-core/src/java/org/apache/maven/jelly/tags/BaseTagSupport.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BaseTagSupport.java       8 Jan 2004 22:20:48 -0000       1.1
  +++ BaseTagSupport.java       26 Jan 2004 11:49:56 -0000      1.2
  @@ -70,6 +70,11 @@
           super();
       }
   
  +    public BaseTagSupport(boolean trim)
  +    {
  +        super(trim);
  +    }
  +    
       public MavenJellyContext getMavenContext()
       {
           JellyContext context = getContext();
  
  
  
  1.1                  
maven-components/maven-core/src/java/org/apache/maven/jelly/tags/MavenTagSupport.java
  
  Index: MavenTagSupport.java
  ===================================================================
  package org.apache.maven.jelly.tags;
  
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Maven" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Maven", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * ====================================================================
   */
  
  public abstract class MavenTagSupport
      extends BaseTagSupport
  {
      public MavenTagSupport()
      {
          super();
      }
      
      public MavenTagSupport(boolean trim)
      {
          super(trim);
      }
  }
  
  
  
  1.3       +3 -3      
maven-components/maven-core/src/java/org/apache/maven/jelly/tags/maven/PomTag.java
  
  Index: PomTag.java
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-core/src/java/org/apache/maven/jelly/tags/maven/PomTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PomTag.java       25 Jan 2004 00:29:10 -0000      1.2
  +++ PomTag.java       26 Jan 2004 11:49:56 -0000      1.3
  @@ -59,7 +59,7 @@
   import org.apache.commons.jelly.JellyTagException;
   import org.apache.commons.jelly.MissingAttributeException;
   import org.apache.commons.jelly.XMLOutput;
  -import org.apache.maven.MavenStaticUtils;
  +import org.apache.maven.MavenUtils;
   import org.apache.maven.jelly.tags.MavenTagSupport;
   
   import java.io.File;
  @@ -122,7 +122,7 @@
   
           try
           {
  -            context.setVariable( var, MavenStaticUtils.getProject( 
projectDescriptor, false ) );
  +            context.setVariable( var, MavenUtils.getProject( projectDescriptor, 
false ) );
           }
           catch ( Exception e )
           {
  
  
  
  1.3       +5 -5      
maven-components/maven-core/src/java/org/apache/maven/jelly/tags/maven/ReactorTag.java
  
  Index: ReactorTag.java
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-core/src/java/org/apache/maven/jelly/tags/maven/ReactorTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ReactorTag.java   25 Jan 2004 00:29:10 -0000      1.2
  +++ ReactorTag.java   26 Jan 2004 11:49:56 -0000      1.3
  @@ -59,7 +59,7 @@
   import org.apache.commons.jelly.JellyTagException;
   import org.apache.commons.jelly.MissingAttributeException;
   import org.apache.commons.jelly.XMLOutput;
  -import org.apache.maven.MavenStaticUtils;
  +import org.apache.maven.MavenUtils;
   import org.apache.maven.project.MavenProject;
   
   import java.io.File;
  @@ -308,7 +308,7 @@
           List projects = null;
           try
           {
  -            projects = MavenStaticUtils.getProjects( getBasedir(), projectIncludes, 
getExcludes() );
  +            projects = MavenUtils.getProjects( getBasedir(), projectIncludes, 
getExcludes() );
           }
           catch ( Exception anException )
           {
  @@ -319,7 +319,7 @@
   
           try
           {
  -            sortedProjects = MavenStaticUtils.getSortedProjects( projects );
  +            sortedProjects = MavenUtils.getSortedProjects( projects );
           }
           catch ( Exception anException )
           {
  
  
  
  1.3       +2 -2      
maven-components/maven-core/src/java/org/apache/maven/plugin/MavenClasspathBuilder.java
  
  Index: MavenClasspathBuilder.java
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-core/src/java/org/apache/maven/plugin/MavenClasspathBuilder.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MavenClasspathBuilder.java        25 Jan 2004 00:29:11 -0000      1.2
  +++ MavenClasspathBuilder.java        26 Jan 2004 11:49:56 -0000      1.3
  @@ -56,7 +56,7 @@
    * ====================================================================
    */
   
  -import org.apache.maven.MavenStaticUtils;
  +import org.apache.maven.MavenUtils;
   import org.apache.maven.project.MavenProject;
   
   import java.io.File;
  @@ -79,7 +79,7 @@
       {
           StringBuffer classpath = new StringBuffer();
   
  -        List mavenLibs = MavenStaticUtils.getFiles( new File( project.getProperty( 
"maven.home" ), "lib" ), "**/*.jar", "" );
  +        List mavenLibs = MavenUtils.getFiles( new File( project.getProperty( 
"maven.home" ), "lib" ), "**/*.jar", "" );
   
           for ( Iterator i = mavenLibs.iterator(); i.hasNext(); )
           {
  
  
  
  1.4       +3 -3      
maven-components/maven-core/src/java/org/apache/maven/plugin/PluginManager.java
  
  Index: PluginManager.java
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-core/src/java/org/apache/maven/plugin/PluginManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PluginManager.java        25 Jan 2004 00:29:11 -0000      1.3
  +++ PluginManager.java        26 Jan 2004 11:49:56 -0000      1.4
  @@ -67,7 +67,7 @@
   import org.apache.maven.Maven;
   import org.apache.maven.MavenConstants;
   import org.apache.maven.MavenException;
  -import org.apache.maven.MavenStaticUtils;
  +import org.apache.maven.MavenUtils;
   import org.apache.maven.NoGoalException;
   import org.apache.maven.artifact.MavenArtifact;
   import org.apache.maven.grant.GrantProject;
  @@ -591,7 +591,7 @@
   
           if ( pluginPropertiesFile.exists() )
           {
  -            Map pluginProperties = MavenStaticUtils.loadProperties( 
pluginPropertiesFile );
  +            Map pluginProperties = MavenUtils.loadProperties( pluginPropertiesFile 
);
   
               //!!!
               // Add plugin.dir and plugin.resources into the properties so they get 
interpolated
  
  
  
  1.3       +8 -8      
maven-components/maven-core/src/java/org/apache/maven/verifier/DependencyVerifier.java
  
  Index: DependencyVerifier.java
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-core/src/java/org/apache/maven/verifier/DependencyVerifier.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DependencyVerifier.java   25 Jan 2004 00:29:11 -0000      1.2
  +++ DependencyVerifier.java   26 Jan 2004 11:49:56 -0000      1.3
  @@ -59,7 +59,7 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.apache.maven.MavenConstants;
  -import org.apache.maven.MavenStaticUtils;
  +import org.apache.maven.MavenUtils;
   import org.apache.maven.artifact.MavenArtifact;
   import org.apache.maven.project.MavenProject;
   import org.apache.maven.util.HttpUtils;
  @@ -159,7 +159,7 @@
   
           if ( !remoteRepoEnabled )
           {
  -            log.warn( MavenStaticUtils.getMessage( 
"remote.repository.disabled.warning" ) );
  +            log.warn( MavenUtils.getMessage( "remote.repository.disabled.warning" ) 
);
           }
   
           clearFailedDependencies();
  @@ -189,7 +189,7 @@
                   }
                   else if ( !online && artifact.isSnapshot() )
                   {
  -                    log.warn( MavenStaticUtils.getMessage( 
"offline.snapshot.warning", artifact.getName() ) );
  +                    log.warn( MavenUtils.getMessage( "offline.snapshot.warning", 
artifact.getName() ) );
                   }
               }
           }
  @@ -225,11 +225,11 @@
   
           if ( failedDependencies.size() == 1 )
           {
  -            message.append( MavenStaticUtils.getMessage( 
"single.unsatisfied.dependency.error" ) );
  +            message.append( MavenUtils.getMessage( 
"single.unsatisfied.dependency.error" ) );
           }
           else
           {
  -            message.append( MavenStaticUtils.getMessage( 
"multiple.unsatisfied.dependency.error" ) );
  +            message.append( MavenUtils.getMessage( 
"multiple.unsatisfied.dependency.error" ) );
           }
   
           message.append( "\n\n" );
  @@ -286,7 +286,7 @@
                   directory.mkdirs();
               }
   
  -            log.info( MavenStaticUtils.getMessage( "download.message", 
artifact.getName() ) );
  +            log.info( MavenUtils.getMessage( "download.message", artifact.getName() 
) );
   
               if ( getRemoteArtifact( project, artifact ) )
               {
  @@ -306,7 +306,7 @@
                   }
                   else
                   {
  -                    String warning = MavenStaticUtils.getMessage( 
"failed.download.warning", artifact.getName() );
  +                    String warning = MavenUtils.getMessage( 
"failed.download.warning", artifact.getName() );
                       log.warn( warning );
                   }
               }
  
  
  
  1.3       +7 -7      
maven-components/maven-core/src/java/org/apache/maven/verifier/LocalSettingsVerifier.java
  
  Index: LocalSettingsVerifier.java
  ===================================================================
  RCS file: 
/home/cvs/maven-components/maven-core/src/java/org/apache/maven/verifier/LocalSettingsVerifier.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LocalSettingsVerifier.java        25 Jan 2004 00:29:11 -0000      1.2
  +++ LocalSettingsVerifier.java        26 Jan 2004 11:49:56 -0000      1.3
  @@ -57,7 +57,7 @@
    */
   
   import org.apache.maven.MavenConstants;
  -import org.apache.maven.MavenStaticUtils;
  +import org.apache.maven.MavenUtils;
   import org.apache.maven.project.MavenProject;
   
   import java.io.File;
  @@ -91,29 +91,29 @@
           {
               // This is not likely to happen any more as it defaults
               // to ${maven.home}/repository which is set in the driver.properties
  -            throw new RepoConfigException( MavenStaticUtils.getMessage( 
"maven.repo.local.unset" ) );
  +            throw new RepoConfigException( MavenUtils.getMessage( 
"maven.repo.local.unset" ) );
           }
   
           File localRepo = new File( localRepoProp );
   
           if ( localRepo.exists() == false )
           {
  -            System.err.println( MavenStaticUtils.getMessage( 
"directory.nonexistant.warning", localRepo ) );
  +            System.err.println( MavenUtils.getMessage( 
"directory.nonexistant.warning", localRepo ) );
   
               if ( localRepo.mkdirs() == false )
               {
  -                throw new RepoConfigException( MavenStaticUtils.getMessage( 
"cannot.create.directory.warning", localRepo ) );
  +                throw new RepoConfigException( MavenUtils.getMessage( 
"cannot.create.directory.warning", localRepo ) );
               }
           }
   
           if ( localRepo.isDirectory() == false )
           {
  -            throw new RepoConfigException( MavenStaticUtils.getMessage( 
"not.directory.warning", localRepo ) );
  +            throw new RepoConfigException( MavenUtils.getMessage( 
"not.directory.warning", localRepo ) );
           }
   
           if ( localRepo.canWrite() == false )
           {
  -            throw new RepoConfigException( MavenStaticUtils.getMessage( 
"not.writable.warning", localRepo ) );
  +            throw new RepoConfigException( MavenUtils.getMessage( 
"not.writable.warning", localRepo ) );
           }
       }
   }
  
  
  

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

Reply via email to