You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/05/15 23:52:10 UTC

svn commit: r775363 - in /maven/components/branches/MNG-2766: maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderBehaviorTest.java maven-repository/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java

Author: bentmann
Date: Fri May 15 21:52:10 2009
New Revision: 775363

URL: http://svn.apache.org/viewvc?rev=775363&view=rev
Log:
o Fixed file:// URL handling

Modified:
    maven/components/branches/MNG-2766/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderBehaviorTest.java
    maven/components/branches/MNG-2766/maven-repository/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java

Modified: maven/components/branches/MNG-2766/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderBehaviorTest.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderBehaviorTest.java?rev=775363&r1=775362&r2=775363&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderBehaviorTest.java (original)
+++ maven/components/branches/MNG-2766/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderBehaviorTest.java Fri May 15 21:52:10 2009
@@ -42,8 +42,8 @@
 
         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();

Modified: maven/components/branches/MNG-2766/maven-repository/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-repository/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java?rev=775363&r1=775362&r2=775363&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-repository/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java (original)
+++ maven/components/branches/MNG-2766/maven-repository/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java Fri May 15 21:52:10 2009
@@ -191,18 +191,11 @@
     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()