diff --git a/sandbox/repoclean/install.sh b/sandbox/repoclean/install.sh index c7b0aa7c24..08fe4c1100 100644 --- a/sandbox/repoclean/install.sh +++ b/sandbox/repoclean/install.sh @@ -37,15 +37,33 @@ ret=$?; if [ $ret != 0 ]; then exit $ret; fi echo "" cp -f target/repoclean-1.0-SNAPSHOT.jar $1/lib + cp -f $2/plexus/plexus-container-default/1.0-alpha-2/plexus-container-default-1.0-alpha-2.jar $1/lib + cp -f $2/plexus/plexus-utils/1.0-alpha-2/plexus-utils-1.0-alpha-2.jar $1/lib - cp -f $2/plexus/plexus-mail-sender-api/1.0-alpha-1-SNAPSHOT/plexus-mail-sender-api-1.0-alpha-1-SNAPSHOT.jar $1/lib - cp -f $2/plexus/plexus-mail-sender-simple/1.0-alpha-1-SNAPSHOT/plexus-mail-sender-simple-1.0-alpha-1-SNAPSHOT.jar $1/lib + + version=`cat $2/plexus/plexus-mail-sender-api/1.0-alpha-1-SNAPSHOT/plexus-mail-sender-api-1.0-alpha-1-SNAPSHOT.version.txt` + cp -f $2/plexus/plexus-mail-sender-api/1.0-alpha-1-SNAPSHOT/plexus-mail-sender-api-$version.jar $1/lib + version="ERROR-IN-SCRIPT" + + version=`cat $2/plexus/plexus-mail-sender-simple/1.0-alpha-1-SNAPSHOT/plexus-mail-sender-simple-1.0-alpha-1-SNAPSHOT.version.txt` + cp -f $2/plexus/plexus-mail-sender-simple/1.0-alpha-1-SNAPSHOT/plexus-mail-sender-simple-$version.jar $1/lib + version="ERROR-IN-SCRIPT" + cp -f $2/classworlds/classworlds/1.1-alpha-1/classworlds-1.1-alpha-1.jar $1/lib - cp -f $2/org/apache/maven/maven-artifact/2.0-SNAPSHOT/maven-artifact-2.0-SNAPSHOT.jar $1/lib - cp -f $2/org/apache/maven/maven-model/2.0-SNAPSHOT/maven-model-2.0-SNAPSHOT.jar $1/lib + + version=`cat $2/org/apache/maven/maven-artifact/2.0-SNAPSHOT/maven-artifact-2.0-SNAPSHOT.version.txt` + cp -f $2/org/apache/maven/maven-artifact/2.0-SNAPSHOT/maven-artifact-$version.jar $1/lib + version="ERROR-IN-SCRIPT" + + version=`cat $2/org/apache/maven/maven-model/2.0-SNAPSHOT/maven-model-2.0-SNAPSHOT.version.txt` + cp -f $2/org/apache/maven/maven-model/2.0-SNAPSHOT/maven-model-$version.jar $1/lib + version="ERROR-IN-SCRIPT" + cp -f $2/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-2/wagon-provider-api-1.0-alpha-2.jar $1/lib + 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'..." diff --git a/sandbox/repoclean/src/main/bash/repoclean.sh b/sandbox/repoclean/src/main/bash/repoclean.sh index e8f40cfcd1..770b695552 100644 --- a/sandbox/repoclean/src/main/bash/repoclean.sh +++ b/sandbox/repoclean/src/main/bash/repoclean.sh @@ -1,16 +1,13 @@ #!/bin/bash CP=./lib/repoclean-1.0-SNAPSHOT.jar -CP=$CP:./lib/plexus-container-default-1.0-alpha-2.jar -CP=$CP:./lib/plexus-utils-1.0-alpha-2.jar -CP=$CP:./lib/plexus-mail-sender-api-1.0-alpha-1-SNAPSHOT.jar -CP=$CP:./lib/plexus-mail-sender-simple-1.0-alpha-1-SNAPSHOT.jar -CP=$CP:./lib/classworlds-1.1-alpha-1.jar -CP=$CP:./lib/maven-artifact-2.0-SNAPSHOT.jar -CP=$CP:./lib/maven-model-2.0-SNAPSHOT.jar -CP=$CP:./lib/wagon-provider-api-1.0-alpha-2.jar -CP=$CP:./lib/wagon-file-1.0-alpha-2.jar -CP=$CP:./lib/wagon-http-lightweight-1.0-alpha-2.jar + +for lib in `ls -1 ./lib | grep -v 'repoclean'` +do + + CP=$CP:./lib/$lib + +done cygwin=false case "`uname`" in diff --git a/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/RepositoryCleaner.java b/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/RepositoryCleaner.java index 8818a3603c..c07e7f1d80 100644 --- a/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/RepositoryCleaner.java +++ b/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/RepositoryCleaner.java @@ -29,6 +29,7 @@ import org.apache.maven.tools.repoclean.rewrite.ArtifactPomRewriter; import org.codehaus.plexus.PlexusConstants; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.context.Context; +import org.codehaus.plexus.context.ContextException; import org.codehaus.plexus.logging.AbstractLogEnabled; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.mailsender.MailMessage; @@ -350,6 +351,11 @@ public class RepositoryCleaner } } + else if( !targetMissingOrOlder ) + { + artifactReporter.warn( "Target file for artifact is present and not stale. (Artifact: \'" + artifact.getId() + + "\' in path: \'" + artifactSource + "\' with target path: " + artifactTarget + ")." ); + } else { artifactReporter.error( "Cannot find source file for artifact: \'" + artifact.getId() @@ -500,8 +506,7 @@ public class RepositoryCleaner return reportsBase; } - public void contextualize( Context context ) - throws Exception + public void contextualize( Context context ) throws ContextException { this.container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY ); }