mirror of https://github.com/apache/maven.git
[MNG-4305] [regression] ${localRepository.basedir} is not a proper path
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@805061 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
00ed1a01c0
commit
b725e30dea
|
@ -267,6 +267,9 @@ public class MavenArtifactRepository
|
|||
{
|
||||
retValue = retValue.charAt( 0 ) + ":" + retValue.substring( 2 );
|
||||
}
|
||||
|
||||
// normalize separators
|
||||
retValue = new File( retValue ).getPath();
|
||||
}
|
||||
|
||||
if ( retValue == null )
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.apache.maven.repository;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -186,7 +187,7 @@ public class MirrorProcessorTest
|
|||
ArtifactRepository repo = repos.get( 0 );
|
||||
assertEquals( "file:///tmp", repo.getUrl() );
|
||||
assertEquals( "file", repo.getProtocol() );
|
||||
assertEquals( "/tmp", repo.getBasedir() );
|
||||
assertEquals( File.separator + "tmp", repo.getBasedir() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -135,4 +135,22 @@ public class LegacyRepositorySystemTest
|
|||
assertTrue( result.hasMissingArtifacts() );
|
||||
}
|
||||
}
|
||||
|
||||
public void testLocalRepositoryBasedir()
|
||||
throws Exception
|
||||
{
|
||||
File localRepoDir = new File( "" ).getAbsoluteFile();
|
||||
|
||||
ArtifactRepository localRepo = repositorySystem.createLocalRepository( localRepoDir );
|
||||
|
||||
String basedir = localRepo.getBasedir();
|
||||
|
||||
assertFalse( basedir.endsWith( "/" ) );
|
||||
assertFalse( basedir.endsWith( "\\" ) );
|
||||
|
||||
assertEquals( localRepoDir, new File( basedir ) );
|
||||
|
||||
assertEquals( localRepoDir.getPath(), basedir );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue