svn commit: r169330 - in /maven/components/trunk/sandbox/repoclean: install.sh src/main/bash/repoclean.sh src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java src/main/resources/META-INF/plexus/components.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r169330 - in /maven/components/trunk/sandbox/repoclean: install.sh src/main/bash/repoclean.sh src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java src/main/resources/META-INF/plexus/components.xml

John Casey-2
Author: jdcasey
Date: Mon May  9 08:36:32 2005
New Revision: 169330

URL: http://svn.apache.org/viewcvs?rev=169330&view=rev
Log:
o Fixed NPE in LegacyArtifactDiscoverer when the resulting Artifact from the buildArtifact() method is null (was an errant debug statement)
o Removed requirement and attempt at copying wagon-http-lightweight when ./install.sh runs.
o Cleaned up the output from ./repoclean.sh to remove a couple debug lines
o Fixed components.xml to comply with the new component refactorings (simplified RepositoryCleaner using two new processing phases: DiscoveryPhase and RewritePhase, with NO common interface)

We should be ready to process mixed bags of m1 and m2 poms in the same source repo now!

Modified:
    maven/components/trunk/sandbox/repoclean/install.sh
    maven/components/trunk/sandbox/repoclean/src/main/bash/repoclean.sh
    maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java
    maven/components/trunk/sandbox/repoclean/src/main/resources/META-INF/plexus/components.xml

Modified: maven/components/trunk/sandbox/repoclean/install.sh
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/install.sh?rev=169330&r1=169329&r2=169330&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/install.sh (original)
+++ maven/components/trunk/sandbox/repoclean/install.sh Mon May  9 08:36:32 2005
@@ -65,8 +65,6 @@
 
     cp -f $2/org/apache/maven/wagon/wagon-file/1.0-alpha-2/wagon-file-1.0-alpha-2.jar $1/lib
 
-    cp -f $2/org/apache/maven/wagon/wagon-http-lightweight/1.0-alpha-2/wagon-http-lightweight-1.0-alpha-2.jar $1/lib
-
     echo "Copying startup script, and changing its permissions to '+x'..."
     echo ""
     

Modified: maven/components/trunk/sandbox/repoclean/src/main/bash/repoclean.sh
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/bash/repoclean.sh?rev=169330&r1=169329&r2=169330&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/bash/repoclean.sh (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/bash/repoclean.sh Mon May  9 08:36:32 2005
@@ -2,19 +2,14 @@
 
 mypath=`which $0`
 
-echo "mypath: $mypath"
-
 mydir=`pwd`
 
 if [ "" != "$mypath" ]; then
 
-  echo "Setting mydir based on mypath..."
   mydir=`dirname $mypath`
 
 fi
 
-echo "mydir: $mydir"
-
 CP=$mydir/lib/repoclean-1.0-SNAPSHOT.jar
 
 for lib in `ls -1 $mydir/lib | grep -v 'repoclean'`
@@ -46,4 +41,4 @@
   JAVA_HOME=/usr/local/java
 fi
 
-nice -n 19 $JAVA_HOME/bin/java -Xmx128M -Xms64M -Xincgc $JAVA_OPTS -classpath ${CP} org.apache.maven.tools.repoclean.Main $* | tee repoclean-log.txt
+nice -n 19 $JAVA_HOME/bin/java -Xmx128M -Xms64M -Xincgc $JAVA_OPTS -classpath ${CP} org.apache.maven.tools.repoclean.Main $*

Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java?rev=169330&r1=169329&r2=169330&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java Mon May  9 08:36:32 2005
@@ -18,6 +18,7 @@
 import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.tools.repoclean.report.PathLister;
 import org.apache.maven.tools.repoclean.report.Reporter;
+import org.codehaus.plexus.util.StringUtils;
 
 import java.io.File;
 import java.util.ArrayList;
@@ -293,18 +294,23 @@
             }
             else
             {
-                result = artifactFactory.createArtifact( groupId, artifactId, version, Artifact.SCOPE_RUNTIME, type );
+                if ( StringUtils.isNotEmpty( groupId ) && StringUtils.isNotEmpty( artifactId )
+                    && StringUtils.isNotEmpty( version ) && StringUtils.isNotEmpty( type ) )
+                {
+                    result = artifactFactory
+                        .createArtifact( groupId, artifactId, version, Artifact.SCOPE_RUNTIME, type );
+                }
             }
 
-            getLogger().debug(
-                               "Resulting artifact is: " + result.getId() + " and has classifier of: "
-                                   + result.getClassifier() + "\n\n" );
+//            getLogger().debug(
+//                               "Resulting artifact is: " + result + " and has classifier of: "
+//                                   + result.getClassifier() + "\n\n" );
 
             return result;
         }
         catch ( RuntimeException e )
         {
-            getLogger().error( "While parsing artifact path: \'" + path + "\'...\n\n", e );
+            getLogger().error( "While parsing artifact path: \'" + path + "\'...", e );
 
             throw e;
         }

Modified: maven/components/trunk/sandbox/repoclean/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/resources/META-INF/plexus/components.xml?rev=169330&r1=169329&r2=169330&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/resources/META-INF/plexus/components.xml Mon May  9 08:36:32 2005
@@ -5,18 +5,44 @@
       <implementation>org.apache.maven.tools.repoclean.RepositoryCleaner</implementation>
       <requirements>
         <requirement>
-          <role>org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout</role>
-          <role-hint>alpha-bridging</role-hint>
-          <field-name>bridgingLayout</field-name>
+          <role>org.apache.maven.tools.repoclean.index.ArtifactIndexer</role>
         </requirement>
         <requirement>
-          <role>org.apache.maven.tools.repoclean.digest.DigestVerifier</role>
+          <role>org.codehaus.plexus.mailsender.MailSender</role>
         </requirement>
         <requirement>
-          <role>org.apache.maven.tools.repoclean.index.ArtifactIndexer</role>
+          <role>org.apache.maven.tools.repoclean.phase.DiscoveryPhase</role>
         </requirement>
         <requirement>
-          <role>org.codehaus.plexus.mailsender.MailSender</role>
+          <role>org.apache.maven.tools.repoclean.phase.RewritePhase</role>
+        </requirement>
+      </requirements>
+    </component>
+    <!--
+     |
+     |
+     |
+     -->
+    <component>
+      <role>org.apache.maven.tools.repoclean.phase.DiscoveryPhase</role>
+      <implementation>org.apache.maven.tools.repoclean.phase.DiscoveryPhase</implementation>
+    </component>
+    <!--
+     |
+     |
+     |
+     -->
+    <component>
+      <role>org.apache.maven.tools.repoclean.phase.RewritePhase</role>
+      <implementation>org.apache.maven.tools.repoclean.phase.RewritePhase</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout</role>
+          <role-hint>alpha-bridging</role-hint>
+          <field-name>bridgingLayout</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.tools.repoclean.digest.DigestVerifier</role>
         </requirement>
       </requirements>
     </component>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]