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
This commit is contained in:
John Dennis Casey 2005-04-21 20:47:20 +00:00
parent a02dd8e9d9
commit 35cc18bfbd
2 changed files with 3 additions and 10 deletions

View File

@ -288,7 +288,7 @@ private void rewriteArtifactsAndPoms( List artifacts, ArtifactRepository sourceR
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 @@ private void rewriteArtifactsAndPoms( List artifacts, ArtifactRepository sourceR
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 );

View File

@ -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 void rewrite( Artifact artifact, File from, File to, FileReporter reporte
FileWriter toWriter = null;
try
{
toWriter = new FileWriter( target );
toWriter = new FileWriter( to );
MavenXpp3Writer v4Writer = new MavenXpp3Writer();
v4Writer.write( toWriter, v4Model );
}