diff --git a/sandbox/repoclean/install.sh b/sandbox/repoclean/install.sh index 581edcd4a9..9c19232c64 100644 --- a/sandbox/repoclean/install.sh +++ b/sandbox/repoclean/install.sh @@ -65,8 +65,6 @@ ret=$?; if [ $ret != 0 ]; then exit $ret; fi 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 "" diff --git a/sandbox/repoclean/src/main/bash/repoclean.sh b/sandbox/repoclean/src/main/bash/repoclean.sh index c1e23a7578..a004aefb0e 100644 --- a/sandbox/repoclean/src/main/bash/repoclean.sh +++ b/sandbox/repoclean/src/main/bash/repoclean.sh @@ -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 @@ if [ -z "$JAVA_HOME" ]; then 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 $* diff --git a/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java b/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java index 060c582a5e..cd0eb83f82 100644 --- a/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java +++ b/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java @@ -18,6 +18,7 @@ import org.apache.maven.artifact.Artifact; 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 @@ public class LegacyArtifactDiscoverer } 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; } diff --git a/sandbox/repoclean/src/main/resources/META-INF/plexus/components.xml b/sandbox/repoclean/src/main/resources/META-INF/plexus/components.xml index 5096a25e06..027592348c 100644 --- a/sandbox/repoclean/src/main/resources/META-INF/plexus/components.xml +++ b/sandbox/repoclean/src/main/resources/META-INF/plexus/components.xml @@ -3,6 +3,38 @@ org.apache.maven.tools.repoclean.RepositoryCleaner org.apache.maven.tools.repoclean.RepositoryCleaner + + + org.apache.maven.tools.repoclean.index.ArtifactIndexer + + + org.codehaus.plexus.mailsender.MailSender + + + org.apache.maven.tools.repoclean.phase.DiscoveryPhase + + + org.apache.maven.tools.repoclean.phase.RewritePhase + + + + + + org.apache.maven.tools.repoclean.phase.DiscoveryPhase + org.apache.maven.tools.repoclean.phase.DiscoveryPhase + + + + org.apache.maven.tools.repoclean.phase.RewritePhase + org.apache.maven.tools.repoclean.phase.RewritePhase org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout @@ -12,12 +44,6 @@ org.apache.maven.tools.repoclean.digest.DigestVerifier - - org.apache.maven.tools.repoclean.index.ArtifactIndexer - - - org.codehaus.plexus.mailsender.MailSender -