Return-Path: Mailing-List: contact turbine-maven-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list turbine-maven-dev@jakarta.apache.org Received: (qmail 971 invoked by uid 97); 2 Dec 2002 05:02:22 -0000 Received: (qmail 967 invoked by uid 98); 2 Dec 2002 05:02:22 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 946 invoked from network); 2 Dec 2002 05:02:20 -0000 Received: from daedalus.apache.org (HELO apache.org) (63.251.56.142) by nagoya.betaversion.org with SMTP; 2 Dec 2002 05:02:20 -0000 Received: (qmail 92349 invoked by uid 500); 2 Dec 2002 05:01:05 -0000 Received: (qmail 92340 invoked from network); 2 Dec 2002 05:01:05 -0000 Received: from icarus.apache.org (63.251.56.143) by daedalus.apache.org with SMTP; 2 Dec 2002 05:01:05 -0000 Received: (qmail 99936 invoked by uid 1162); 2 Dec 2002 05:01:04 -0000 Date: 2 Dec 2002 05:01:04 -0000 Message-ID: <20021202050104.99935.qmail@icarus.apache.org> From: jvanzyl@apache.org To: jakarta-turbine-maven-cvs@apache.org Subject: cvs commit: jakarta-turbine-maven/src/java/org/apache/maven/verifier ProjectVerifier.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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; } }