mirror of https://github.com/apache/maven.git
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:
parent
7afb4637c8
commit
5a2ef49f1d
|
@ -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();
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue