maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r657432 - in /maven/components/branches/maven-2.0.x/maven-artifact-test: pom.xml src/main/java/org/apache/maven/artifact/test/ArtifactTestCase.java
Date Sat, 17 May 2008 19:29:41 GMT
Author: hboutemy
Date: Sat May 17 12:29:41 2008
New Revision: 657432

URL: http://svn.apache.org/viewvc?rev=657432&view=rev
Log:
o added maven.repo.local property support
o added encoding support when reading settings.xml file

Modified:
    maven/components/branches/maven-2.0.x/maven-artifact-test/pom.xml
    maven/components/branches/maven-2.0.x/maven-artifact-test/src/main/java/org/apache/maven/artifact/test/ArtifactTestCase.java

Modified: maven/components/branches/maven-2.0.x/maven-artifact-test/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-artifact-test/pom.xml?rev=657432&r1=657431&r2=657432&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-artifact-test/pom.xml (original)
+++ maven/components/branches/maven-2.0.x/maven-artifact-test/pom.xml Sat May 17 12:29:41
2008
@@ -51,5 +51,9 @@
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-container-default</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+    </dependency>
   </dependencies>
 </project>

Modified: maven/components/branches/maven-2.0.x/maven-artifact-test/src/main/java/org/apache/maven/artifact/test/ArtifactTestCase.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-artifact-test/src/main/java/org/apache/maven/artifact/test/ArtifactTestCase.java?rev=657432&r1=657431&r2=657432&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-artifact-test/src/main/java/org/apache/maven/artifact/test/ArtifactTestCase.java
(original)
+++ maven/components/branches/maven-2.0.x/maven-artifact-test/src/main/java/org/apache/maven/artifact/test/ArtifactTestCase.java
Sat May 17 12:29:41 2008
@@ -26,9 +26,9 @@
 import org.apache.maven.settings.Settings;
 import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader;
 import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.util.ReaderFactory;
 
 import java.io.File;
-import java.io.FileReader;
 
 /**
  * Test case that builds standard artifact stuff like repositories.
@@ -51,12 +51,16 @@
     {
         super.setUp();
 
-        File settingsFile = new File( System.getProperty( "user.home" ), ".m2/settings.xml"
);
-        String localRepo = null;
-        if ( settingsFile.exists() )
+        String localRepo = System.getProperty( "maven.repo.local" );
+
+        if ( localRepo == null )
         {
-            Settings settings = new SettingsXpp3Reader().read( new FileReader( settingsFile
) );
-            localRepo = settings.getLocalRepository();
+            File settingsFile = new File( System.getProperty( "user.home" ), ".m2/settings.xml"
);
+            if ( settingsFile.exists() )
+            {
+                Settings settings = new SettingsXpp3Reader().read( ReaderFactory.newXmlReader(
settingsFile ) );
+                localRepo = settings.getLocalRepository();
+            }
         }
         if ( localRepo == null )
         {



Mime
View raw message