You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-commits@incubator.apache.org by xa...@apache.org on 2007/04/06 13:20:55 UTC

svn commit: r526152 - in /incubator/ivy/core/trunk: ./ doc/doc/tutorial/ src/java/org/apache/ivy/ src/java/org/apache/ivy/ant/ src/java/org/apache/ivy/core/settings/ test/java/org/apache/ivy/ant/ test/java/org/apache/ivy/core/settings/

Author: xavier
Date: Fri Apr  6 06:20:53 2007
New Revision: 526152

URL: http://svn.apache.org/viewvc?view=rev&rev=526152
Log:
NEW: The default public resolver used is now ibiblio with m2 compatible mode (IVY-463)

Added:
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/ivysettings-1.4.xml
Modified:
    incubator/ivy/core/trunk/CHANGES.txt
    incubator/ivy/core/trunk/RELEASE_NOTES
    incubator/ivy/core/trunk/doc/doc/tutorial/defaultconf.html
    incubator/ivy/core/trunk/src/java/org/apache/ivy/Ivy.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyConfigure.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/ivysettings-public.xml
    incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java
    incubator/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ConfigureTest.java

Modified: incubator/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/CHANGES.txt?view=diff&rev=526152&r1=526151&r2=526152
==============================================================================
--- incubator/ivy/core/trunk/CHANGES.txt (original)
+++ incubator/ivy/core/trunk/CHANGES.txt Fri Apr  6 06:20:53 2007
@@ -48,6 +48,7 @@
 =====================================
 - NEW: define artifacts not declared by the dependency module descriptor (IVY-419)
 - NEW: Module wide exclude (IVY-431)
+- NEW: The default public resolver used is now ibiblio with m2 compatible mode (IVY-463)
 
 - IMPROVE: Let user specify Ivy file when using a post-resolve task (IVY-455)
 - IMPROVE: IvyArtifactProperty and IvyArtifactReport tasks should be a post resolve task (IVY-452)

Modified: incubator/ivy/core/trunk/RELEASE_NOTES
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/RELEASE_NOTES?view=diff&rev=526152&r1=526151&r2=526152
==============================================================================
--- incubator/ivy/core/trunk/RELEASE_NOTES (original)
+++ incubator/ivy/core/trunk/RELEASE_NOTES Fri Apr  6 06:20:53 2007
@@ -62,6 +62,17 @@
 Previous names have been deprecated, so previous settings files can still be used, but 
 you will see a deprecation warning.
 
+2.3. public resolver in default settings is now ibiblio in m2 compatible mode
+
+In previous versions Ivy used to use the ivyrep resolver as default public resolver, 
+but ivyrep is no longer maintained, while maven 2 repository on ibiblio is growing rapidly.
+
+Since Ivy is compatible with maven 2 repository, defaulting to the ibiblio maven 2 
+repository makes more sense.
+
+If you have any issue of backward compatibility with these new settings, you can simply 
+set the following ant property before calling configure (implicitly or explicitly):
+ivy.14.compatible=true
 
 3. Migrating from Jayasoft Ivy to Apache Ivy
 

Modified: incubator/ivy/core/trunk/doc/doc/tutorial/defaultconf.html
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/doc/doc/tutorial/defaultconf.html?view=diff&rev=526152&r1=526151&r2=526152
==============================================================================
--- incubator/ivy/core/trunk/doc/doc/tutorial/defaultconf.html (original)
+++ incubator/ivy/core/trunk/doc/doc/tutorial/defaultconf.html Fri Apr  6 06:20:53 2007
@@ -99,16 +99,10 @@
 </code>
 
 <h2>Public</h2>
-By default, the public repository is ivyrep. To change the setting of this resolver, you can use the standard way to configure ivyrep:
-<code>ivy.ivyrep.default.ivy.root</code> specify the root for ivy files
-<code>ivy.ivyrep.default.ivy.pattern</code> specify the layout for ivy files
-<code>ivy.ivyrep.default.artifact.root</code> specify the root for artifacts
-<code>ivy.ivyrep.default.artifact.pattern</code> specify the layout for artifacts
-For instance:
-<code>
-ivy.ivyrep.default.ivy.root=http://myserver/ivy/
-ivy.ivyrep.default.artifact.root=http://myserver/ivy/
-</code>
+By default, the public repository is ibiblio in m2 compatible mode. 
+
+<em>In 1.4 version Ivy was using ivyrep has default resolver, if you want to restore this, set
+ivy.14.compatible=true as an ant property</em>
 
 <h1>Going further</h1>
 OK, so we have seen how to easily change the settings of the three main repositories. But what if I want my shared repository is on a web server ? What if the public repository is not compatible with ivyrep ? What if ... 
@@ -156,7 +150,7 @@
 <code type="xml">
 <ivysettings>
   <resolvers>
-    <ivyrep name="public"/>
+    <ibiblio name="public" m2compatible="true"/>
   </resolvers>
 </ivysettings>
 </code>

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/Ivy.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/Ivy.java?view=diff&rev=526152&r1=526151&r2=526152
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/Ivy.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/Ivy.java Fri Apr  6 06:20:53 2007
@@ -207,6 +207,15 @@
 		postConfigure();
 	}
 	
+	/**
+	 * Configures Ivy with 1.4 compatible default settings
+	 */
+	public void configureDefault14() throws ParseException, IOException {
+		assertBound();
+		_settings.loadDefault14();
+		postConfigure();
+	}
+	
 	/////////////////////////////////////////////////////////////////////////
     //                         CHECK
     /////////////////////////////////////////////////////////////////////////

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyConfigure.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyConfigure.java?view=diff&rev=526152&r1=526151&r2=526152
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyConfigure.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyConfigure.java Fri Apr  6 06:20:53 2007
@@ -158,9 +158,15 @@
 	                }
 				}
                 if (!_file.exists()) {
-                    Message.info("no settings file found, using default...");
-                    _file = null;
-                    _url = IvySettings.getDefaultSettingsURL();
+                	if (Boolean.valueOf(getProject().getProperty("ivy.14.compatible")).booleanValue()) {
+	                    Message.info("no settings file found, using Ivy 1.4 default...");
+	                    _file = null;
+	                    _url = IvySettings.getDefault14SettingsURL();
+                	} else {
+	                    Message.info("no settings file found, using default...");
+	                    _file = null;
+	                    _url = IvySettings.getDefaultSettingsURL();
+                	}
                 }
             } 
             if (_file != null) {

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java?view=diff&rev=526152&r1=526151&r2=526152
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java Fri Apr  6 06:20:53 2007
@@ -303,6 +303,10 @@
         load(getDefaultSettingsURL());
     }
 
+    public void loadDefault14() throws ParseException, IOException {
+        load(getDefault14SettingsURL());
+    }
+
 	private void loadDefaultProperties() throws IOException {
 		loadProperties(getDefaultPropertiesURL(), false);
 	}
@@ -313,6 +317,10 @@
 	
     public static URL getDefaultSettingsURL() {
         return getSettingsURL("ivysettings.xml");
+    }
+
+    public static URL getDefault14SettingsURL() {
+        return getSettingsURL("ivysettings-1.4.xml");
     }
 
 	private String getDefaultSettingsDir() {

Added: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/ivysettings-1.4.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/ivysettings-1.4.xml?view=auto&rev=526152
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/ivysettings-1.4.xml (added)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/ivysettings-1.4.xml Fri Apr  6 06:20:53 2007
@@ -0,0 +1,28 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.    
+-->
+<ivysettings>
+	<settings defaultResolver="default"/>
+	<resolvers>
+		<ivyrep name="public" />
+	</resolvers>
+	<include url="${ivy.default.settings.dir}/ivysettings-shared.xml"/>
+	<include url="${ivy.default.settings.dir}/ivysettings-local.xml"/>
+	<include url="${ivy.default.settings.dir}/ivysettings-main-chain.xml"/>
+	<include url="${ivy.default.settings.dir}/ivysettings-default-chain.xml"/>
+</ivysettings>

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/ivysettings-public.xml
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/ivysettings-public.xml?view=diff&rev=526152&r1=526151&r2=526152
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/ivysettings-public.xml (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/ivysettings-public.xml Fri Apr  6 06:20:53 2007
@@ -18,6 +18,6 @@
 -->
 <ivysettings>
 	<resolvers>
-		<ivyrep name="public"/>
+		<ibiblio name="public" m2compatible="true"/>
 	</resolvers>
 </ivysettings>

Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java?view=diff&rev=526152&r1=526151&r2=526152
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java (original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java Fri Apr  6 06:20:53 2007
@@ -23,6 +23,9 @@
 
 import org.apache.ivy.Ivy;
 import org.apache.ivy.core.settings.IvySettings;
+import org.apache.ivy.plugins.resolver.DependencyResolver;
+import org.apache.ivy.plugins.resolver.IBiblioResolver;
+import org.apache.ivy.plugins.resolver.IvyRepResolver;
 import org.apache.tools.ant.Project;
 
 
@@ -36,6 +39,36 @@
 
         _configure = new IvyConfigure();
         _configure.setProject(project);
+    }
+
+    public void testDefault() throws Exception {
+    	// by default configure look in the current directory for an ivysettings.xml file...
+    	// but Ivy itself has one, and we don't want to use it
+    	_configure.getProject().setProperty("ivy.settings.file", "no/settings/will/use/default.xml");
+        _configure.execute();
+        
+        IvySettings settings = getIvyInstance().getSettings();
+		assertNotNull(settings.getDefaultResolver());
+		
+        DependencyResolver publicResolver = settings.getResolver("public");
+		assertNotNull(publicResolver);
+		assertTrue(publicResolver instanceof IBiblioResolver);
+		IBiblioResolver ibiblio = (IBiblioResolver) publicResolver;
+		assertTrue(ibiblio.isM2compatible());
+    }
+
+    public void testDefault14() throws Exception {
+    	// by default configure look in the current directory for an ivysettings.xml file...
+    	// but Ivy itself has one, and we don't want to use it
+    	_configure.getProject().setProperty("ivy.settings.file", "no/settings/will/use/default.xml");
+    	_configure.getProject().setProperty("ivy.14.compatible", "true");
+        _configure.execute();
+        
+        IvySettings settings = getIvyInstance().getSettings();
+		assertNotNull(settings.getDefaultResolver());
+		
+        DependencyResolver publicResolver = settings.getResolver("public");
+		assertTrue(publicResolver instanceof IvyRepResolver);
     }
 
     public void testFile() throws Exception {

Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ConfigureTest.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ConfigureTest.java?view=diff&rev=526152&r1=526151&r2=526152
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ConfigureTest.java (original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ConfigureTest.java Fri Apr  6 06:20:53 2007
@@ -25,13 +25,33 @@
 
 import org.apache.ivy.Ivy;
 import org.apache.ivy.plugins.resolver.DependencyResolver;
+import org.apache.ivy.plugins.resolver.IBiblioResolver;
+import org.apache.ivy.plugins.resolver.IvyRepResolver;
 
 public class ConfigureTest extends TestCase {
     public void testDefault() throws ParseException, IOException {
         Ivy ivy = new Ivy();
         ivy.configureDefault();
         
-        assertNotNull(ivy.getSettings().getDefaultResolver());
+        IvySettings settings = ivy.getSettings();
+		assertNotNull(settings.getDefaultResolver());
+		
+        DependencyResolver publicResolver = settings.getResolver("public");
+		assertNotNull(publicResolver);
+		assertTrue(publicResolver instanceof IBiblioResolver);
+		IBiblioResolver ibiblio = (IBiblioResolver) publicResolver;
+		assertTrue(ibiblio.isM2compatible());
+    }
+    
+    public void testDefault14() throws ParseException, IOException {
+        Ivy ivy = new Ivy();
+        ivy.configureDefault14();
+        
+        IvySettings settings = ivy.getSettings();
+		assertNotNull(settings.getDefaultResolver());
+		
+        DependencyResolver publicResolver = settings.getResolver("public");
+		assertTrue(publicResolver instanceof IvyRepResolver);
     }
     
     public void testTypedefWithCustomClasspath() throws Exception {