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/verifier ProjectVerifier.java
Date Tue, 03 Dec 2002 02:49:08 GMT
jvanzyl     2002/12/02 18:49:08

  Modified:    src/java/org/apache/maven/verifier ProjectVerifier.java
  Log:
  o used localized message mechansism
  o general cleanups
  
  Revision  Changes    Path
  1.7       +14 -40    jakarta-turbine-maven/src/java/org/apache/maven/verifier/ProjectVerifier.java
  
  Index: ProjectVerifier.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/verifier/ProjectVerifier.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ProjectVerifier.java	2 Dec 2002 07:31:43 -0000	1.6
  +++ ProjectVerifier.java	3 Dec 2002 02:49:08 -0000	1.7
  @@ -70,10 +70,8 @@
   import java.net.MalformedURLException;
   import java.net.URL;
   import java.util.ArrayList;
  -import java.util.HashMap;
   import java.util.Iterator;
   import java.util.List;
  -import java.util.Map;
   
   /**
    * Make sure that everything that is required for the project to build
  @@ -96,9 +94,6 @@
       /** Log. */
       private static final Log log = LogFactory.getLog( ProjectVerifier.class );
   
  -    /** Verbosity during downloading of missing resources. */
  -    private boolean verbose = false;
  -
       /** Control the use of timestamp comparison when downloading missing resources. */
       private boolean useTimestamp = true;
   
  @@ -111,9 +106,6 @@
       /** List of failed deps. */
       private List failedDependencies;
   
  -    /** Map of failed downloads. Key is URL, value is Boolean */
  -    private Map failedDownloads = new HashMap();
  -
       /** Default ctor. */
       public ProjectVerifier()
       {
  @@ -148,31 +140,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( "maven.repo.local not set" );
  +            throw new RepoConfigException( getMessage( "maven.repo.local.unset" ) );
           }
   
           File localRepo = new File( localRepoProp );
   
  -        if ( !localRepo.exists() )
  +        if ( localRepo.exists() == false )
           {
  -            System.err.println( "Directory '" + localRepo + "' does not exist." );
  -            System.err.println( "Attempting to create." );
  +            System.err.println( getMessage( "directory.nonexistant.warning", localRepo
) );
   
  -            if ( !localRepo.mkdirs() )
  +            if ( localRepo.mkdirs() == false )
               {
  -                throw new RepoConfigException( "Unable to create directory '"
  -                                               + localRepo + "'" );
  +                throw new RepoConfigException( getMessage( "cannot.create.directory.warning",
localRepo ) );
               }
           }
   
  -        if ( !localRepo.isDirectory() )
  +        if ( localRepo.isDirectory() == false )
           {
  -            throw new RepoConfigException( localRepo + " is not a directory." );
  +            throw new RepoConfigException( getMessage( "not.directory.warning", localRepo
) );
           }
   
  -        if ( !localRepo.canWrite() )
  +        if ( localRepo.canWrite() == false )
           {
  -            throw new RepoConfigException( localRepo + " is not writable." );
  +            throw new RepoConfigException( getMessage( "not.writable.warning", localRepo
) );
           }
       }
   
  @@ -197,8 +187,7 @@
   
           if ( remoteRepoEnabled != null && !remoteRepoEnabled.booleanValue() )
           {
  -            log.debug( "The use of the remote repository is disabled. Not verifying dependencies."
);
  -            return;
  +            log.info( getMessage( "remote.repository.disabled.warning") );
           }
   
           clearFailedDependencies();
  @@ -225,11 +214,6 @@
                       directory.mkdirs();
                   }
   
  -                // We are missing a dependency. Either the user didn't
  -                // run update-jars or something else has gone wrong. So
  -                // We'll add the jar to our list of failed dependencies
  -                // and get them when we're done checking all the JARs.
  -                log.debug( "failed dependency: " + artifact.getPath() );
                   failedDependencies.add( artifact );
               }
           }
  @@ -244,17 +228,9 @@
                   File destinationFile = new File( getContext().getMavenRepoLocal(), artifact.getPath()
);
                   String artifactName = artifact.getName();
   
  -                if ( !getRemoteFile( artifact.getUrlPath(), destinationFile ) )
  +                if ( getRemoteFile( artifact.getUrlPath(), destinationFile ) == false )
                   {
  -                    failedDownloads.put( artifact.getUrlPath(), Boolean.TRUE );
  -                    warnings.append( "-------------------------------------"
  -                                     + "------------\n" );
  -                    warnings.append( "W A R N I N G\n" );
  -                    warnings.append( "-------------------------------------"
  -                                     + "-----------\n" );
  -                    warnings.append( "Failed to download dependent file " );
  -                    warnings.append( artifactName );
  -                    warnings.append( "\n\n" );
  +                    warnings.append( getMessage( "failed.download.warning", artifactName
) ).append( "\n" );
                   }
               }
           }
  @@ -293,7 +269,6 @@
                   boolean gotFile = HttpUtils.getFile( new URL( url ),
                                                        localFile,
                                                        url,
  -                                                     verbose,
                                                        ignoreErrors,
                                                        useTimestamp,
                                                        "",
  @@ -309,8 +284,7 @@
               }
               catch ( MalformedURLException mue )
               {
  -                log.info( "Cannot retrieve " + remoteFile + " from "
  -                          + remoteRepo + "; malformed URL", mue );
  +                // do nothing.
               }
           }
   
  
  
  

Mime
View raw message