You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by ma...@apache.org on 2012/02/18 07:53:21 UTC

svn commit: r1245872 - in /ant/ivy/core/trunk: src/java/org/apache/ivy/ant/IvyAntSettings.java test/java/org/apache/ivy/ant/IvyInstallTest.java test/repositories/m2/ivysettings.xml

Author: maartenc
Date: Sat Feb 18 06:53:20 2012
New Revision: 1245872

URL: http://svn.apache.org/viewvc?rev=1245872&view=rev
Log:
Another attempt to fix the failing tests on vmgump and jenkins

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyInstallTest.java
    ant/ivy/core/trunk/test/repositories/m2/ivysettings.xml

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java?rev=1245872&r1=1245871&r2=1245872&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java Sat Feb 18 06:53:20 2012
@@ -338,14 +338,23 @@ public class IvyAntSettings extends Data
             }
         }
         if (!file.exists()) {
+            file = null;
             if (Boolean.valueOf(getProject().getProperty("ivy.14.compatible")).booleanValue()) {
                 task.log("no settings file found, using Ivy 1.4 default...", Project.MSG_VERBOSE);
-                file = null;
                 url = IvySettings.getDefault14SettingsURL();
             } else {
-                task.log("no settings file found, using default...", Project.MSG_VERBOSE);
-                file = null;
-                url = IvySettings.getDefaultSettingsURL();
+                String settingsFileUrl = variableContainer.getVariable("ivy.settings.url");
+                if (settingsFileUrl != null) {
+                    try {
+                        url = new URL(settingsFileUrl);
+                    } catch (MalformedURLException e) {
+                        throw new BuildException("Impossible to configure ivy:settings with given url: " 
+                            + settingsFileUrl + ": " + e.getMessage(), e);
+                    }
+                } else {
+                    task.log("no settings file found, using default...", Project.MSG_VERBOSE);
+                    url = IvySettings.getDefaultSettingsURL();
+                }
             }
         }
     }

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyInstallTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyInstallTest.java?rev=1245872&r1=1245871&r2=1245872&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyInstallTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyInstallTest.java Sat Feb 18 06:53:20 2012
@@ -38,8 +38,6 @@ public class IvyInstallTest extends Test
         
         project = AntTestHelper.newProject();
         
-        project.setProperty("ivy.settings.file", "test/repositories/ivysettings.xml");
-
         install = new IvyInstall();
         install.setProject(project);
         System.setProperty("ivy.cache.dir", cache.getAbsolutePath());
@@ -112,9 +110,9 @@ public class IvyInstallTest extends Test
         assertTrue(new File("build/test/install/org8/mod8.1/a-1.1.txt").exists());        
     }
 
-    public void testInstallWithClassifiers() {
+    public void testInstallWithClassifiers() throws Exception {
         // IVY-1324
-        project.setProperty("ivy.settings.file", "test/repositories/m2/ivysettings.xml");
+        project.setProperty("ivy.settings.url", new File("test/repositories/m2/ivysettings.xml").toURL().toExternalForm());
         install.setOrganisation("org.apache");
         install.setModule("test-sources");
         install.setRevision("1.0");
@@ -225,6 +223,7 @@ public class IvyInstallTest extends Test
     }
 
     public void testDependencyNotFoundFailure() {
+        project.setProperty("ivy.settings.file", "test/repositories/ivysettings.xml");
         install.setOrganisation("xxx");
         install.setModule("yyy");
         install.setRevision("zzz");
@@ -240,6 +239,7 @@ public class IvyInstallTest extends Test
     }
 
     public void testDependencyNotFoundSuccess() {
+        project.setProperty("ivy.settings.file", "test/repositories/ivysettings.xml");
         install.setOrganisation("xxx");
         install.setModule("yyy");
         install.setRevision("zzz");

Modified: ant/ivy/core/trunk/test/repositories/m2/ivysettings.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/m2/ivysettings.xml?rev=1245872&r1=1245871&r2=1245872&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/repositories/m2/ivysettings.xml (original)
+++ ant/ivy/core/trunk/test/repositories/m2/ivysettings.xml Sat Feb 18 06:53:20 2012
@@ -20,7 +20,7 @@
 	<settings defaultCache="${ivy.basedir}/build/cache" defaultResolver="m2"/>
 	<resolvers>
 		<ibiblio name="m2" m2compatible="true" useMavenMetadata="true" 
-		         root="${ivy.settings.url}/.." />
+		         root="${ivy.settings.dir}" />
         <filesystem name="IVY-1324">
             <ivy pattern="${ivy.basedir}/build/test/install/[organisation]/[module]/[artifact]-[revision].[ext]"/>
             <artifact pattern="${ivy.basedir}/build/test/install/[organisation]/[module]/[originalname].[ext]"/>