o Fixed file:// URL handling

git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@775363 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-05-15 21:52:10 +00:00
parent 7afb4637c8
commit 5a2ef49f1d
2 changed files with 7 additions and 14 deletions

View File

@ -42,8 +42,8 @@ public class MavenEmbedderBehaviorTest
MavenEmbedder maven = new MavenEmbedder( configuration );
String expectedPath = ( new File( "/global/maven/local-repository" ) ).getCanonicalPath();
String actualPath = maven.getLocalRepository().getBasedir();
File expectedPath = new File( "/global/maven/local-repository" ).getCanonicalFile();
File actualPath = new File( maven.getLocalRepository().getBasedir() );
assertEquals( expectedPath, actualPath );
maven.stop();

View File

@ -191,18 +191,11 @@ public class LegacyRepositorySystem
public ArtifactRepository createLocalRepository( File localRepository )
throws InvalidRepositoryException
{
try
{
return createRepository( localRepository.toURI().toURL().toString(),
RepositorySystem.DEFAULT_LOCAL_REPO_ID, true,
ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS, true,
ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS,
ArtifactRepositoryPolicy.CHECKSUM_POLICY_IGNORE );
}
catch ( MalformedURLException e )
{
throw new InvalidRepositoryException( "Error creating local repository.", RepositorySystem.DEFAULT_LOCAL_REPO_ID, e );
}
return createRepository( "file://" + localRepository.toURI().getRawPath(),
RepositorySystem.DEFAULT_LOCAL_REPO_ID, true,
ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS, true,
ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS,
ArtifactRepositoryPolicy.CHECKSUM_POLICY_IGNORE );
}
public ArtifactRepository createDefaultRemoteRepository()