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 Mon, 02 Dec 2002 05:01:04 GMT
jvanzyl     2002/12/01 21:01:04

  Modified:    src/java/org/apache/maven/verifier ProjectVerifier.java
  Log:
  o we're not using the non-dist jar list at the moment so we'll replace with a nicer XML
mechanism.
  
  Revision  Changes    Path
  1.4       +2 -105    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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ProjectVerifier.java	2 Dec 2002 03:15:49 -0000	1.3
  +++ ProjectVerifier.java	2 Dec 2002 05:01:04 -0000	1.4
  @@ -89,7 +89,6 @@
    *
    * @todo Create a list of all things that could go wrong and then protect
    *       against them.
  - * @todo Merge the XML POM validation mechanism in here.
    * @todo Make the non-distributable list an XML file and use the
    *       the standard betwixt mechanism for reading it in.
    */
  @@ -155,7 +154,6 @@
           throws Exception
       {
           verifySettings();
  -        contextualize( getContext() );
           verifyDependencies();
       }
   
  @@ -204,15 +202,6 @@
       }
   
       /**
  -     * Set the context for the project verifier.
  -     *
  -     * @param context The maven jelly context.
  -     */
  -    private void contextualize( MavenJellyContext context )
  -    {
  -    }
  -
  -    /**
        * Clear the failed dependencies. Required when reusing the
        * project verifier.
        */
  @@ -255,7 +244,6 @@
               String path = artifact.getPath();
               File jarFile = new File( getContext().getMavenRepoLocal(), path );
   
  -
               if ( log.isDebugEnabled() )
               {
                   log.debug( "Looking for " + jarFile.getCanonicalPath() + "\n\n" );
  @@ -287,64 +275,12 @@
           // them for the user.
           if ( failedDependencies.size() > 0 )
           {
  -            Map nonDistMap;
  -            File f = new File( getContext().getMavenRepoLocal(), NON_DIST_JAR_LIST );
  -
  -            if ( getContext().getOnline().booleanValue() && !getRemoteFile( NON_DIST_JAR_LIST,
f ) )
  -            {
  -                StringBuffer msg = new StringBuffer( 128 );
  -                msg.append( "-----------------------------------------------\n" )
  -                    .append( "W A R N I N G\n" )
  -                    .append( "-----------------------------------------------\n" )
  -                    .append( "Failed to download list of non-distributable\n" )
  -                    .append( "jars " )
  -                    .append( NON_DIST_JAR_LIST )
  -                    .append( "\n" )
  -                    .append( "Will continue with attempted downloads of " )
  -                    .append( "dependent jars.\n\n" );
  -
  -                log.info( msg.toString() );
  -                nonDistMap = new HashMap( 0 );
  -            }
  -            else
  -            {
  -                nonDistMap = getNonDistMap( f );
  -            }
  -
               for ( Iterator i = failedDependencies.iterator(); i.hasNext(); )
               {
                   Artifact artifact = (Artifact) i.next();
  -                File destinationFile = new File( getContext().getMavenRepoLocal(),
  -                                                 artifact.getPath() );
  +                File destinationFile = new File( getContext().getMavenRepoLocal(), artifact.getPath()
);
                   String artifactName = artifact.getName();
   
  -                if ( nonDistMap.containsKey( artifactName ) )
  -                {
  -                    if ( !destinationFile.exists() )
  -                    {
  -                        String[] entry = StringUtils.split(
  -                            (String) nonDistMap.get( artifactName ), "$" );
  -                        String downloadLocation = entry[0];
  -                        String additionalNotes = entry[1];
  -
  -                        warnings.append( "---------------------------------"
  -                                         + "----------------\n" );
  -                        warnings.append( "W A R N I N G\n" );
  -                        warnings.append( "---------------------------------"
  -                                         + "---------------\n" );
  -                        warnings.append( "The following JAR must be "
  -                                         + "downloaded manually:\n" );
  -                        warnings.append( artifactName + "\n" );
  -                        warnings.append( "\n" );
  -                        warnings.append( "You can find the JAR here:\n" );
  -                        warnings.append( downloadLocation + "\n" );
  -                        warnings.append( "\n\n" );
  -                        warnings.append( "NOTE: " + additionalNotes + "\n" );
  -                        continue;
  -                    }
  -                    continue;
  -                }
  -
                   if ( !getRemoteFile( artifact.getUrlPath(), destinationFile ) )
                   {
                       failedDownloads.put( artifact.getUrlPath(), Boolean.TRUE );
  @@ -408,44 +344,5 @@
           }
   
           return gotFile;
  -    }
  -
  -    /**
  -     * Get a list of JARs that cannon be distributed by Maven.
  -     * @param f the file that holds the list of non-distributable jars
  -     * @return a map where the non-distributable jar name is the key and
  -     *     the value is the location where the user can find it
  -     */
  -    private Map getNonDistMap( File f )
  -    {
  -        Map nonDistMap = new HashMap();
  -        String line;
  -
  -        try
  -        {
  -            BufferedReader in = new BufferedReader( new FileReader( f ) );
  -            while ( ( line = in.readLine() ) != null )
  -            {
  -                line = line.trim();
  -
  -                // Allow comments to be placed in the payload
  -                // descriptor.
  -                if ( line.startsWith( "#" ) || line.startsWith( "--" )
  -                    || line.length() < 1 )
  -                {
  -                    continue;
  -                }
  -
  -                String[] entry = StringUtils.split( line, "|" );
  -
  -                nonDistMap.put( entry[0], entry[1] );
  -            }
  -        }
  -        catch ( Exception e )
  -        {
  -            e.printStackTrace();
  -        }
  -
  -        return nonDistMap;
       }
   }
  
  
  

Mime
View raw message