From 35cc18bfbd5c958609a32196b7b67f082f2bdebe Mon Sep 17 00:00:00 2001 From: John Dennis Casey Date: Thu, 21 Apr 2005 20:47:20 +0000 Subject: [PATCH] Fixed '+' to '-' conversion for file paths so it will work with both poms and artifacts. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@164120 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/tools/repoclean/RepositoryCleaner.java | 4 ++-- .../maven/tools/repoclean/rewrite/V3PomRewriter.java | 9 +-------- 2 files changed, 3 insertions(+), 10 deletions(-) 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 13c3946628..f1bcb3ca0e 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 @@ -288,7 +288,7 @@ public class RepositoryCleaner boolean errorOccurred = false; File artifactSource = new File( sourceRepo.getBasedir(), sourceRepo.pathOf( artifact ) ); - File artifactTarget = new File( targetRepo.getBasedir(), targetRepo.pathOf( artifact ) ); + File artifactTarget = new File( targetRepo.getBasedir(), targetRepo.pathOf( artifact ).replace('+', '-') ); transaction.addFile( artifactTarget ); @@ -364,7 +364,7 @@ public class RepositoryCleaner File sourcePom = new File( sourceRepositoryBase, sourceRepo.pathOfMetadata( pom ) ); - File targetPom = new File( targetRepositoryBase, targetRepo.pathOfMetadata( pom ) ); + File targetPom = new File( targetRepositoryBase, targetRepo.pathOfMetadata( pom ).replace('+', '-') ); transaction.addFile( targetPom ); diff --git a/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/rewrite/V3PomRewriter.java b/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/rewrite/V3PomRewriter.java index d324f9100b..39ee3609be 100644 --- a/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/rewrite/V3PomRewriter.java +++ b/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/rewrite/V3PomRewriter.java @@ -41,13 +41,6 @@ public class V3PomRewriter public void rewrite( Artifact artifact, File from, File to, FileReporter reporter, boolean reportOnly ) throws Exception { - // should only have to handle this here...v4 repos shouldn't have this - // problem... - String toPath = to.getPath(); - toPath = toPath.replace( '+', '-' ); - - File target = new File( toPath ); - Model v4Model = null; if ( from.exists() ) @@ -104,7 +97,7 @@ public class V3PomRewriter FileWriter toWriter = null; try { - toWriter = new FileWriter( target ); + toWriter = new FileWriter( to ); MavenXpp3Writer v4Writer = new MavenXpp3Writer(); v4Writer.write( toWriter, v4Model ); }