ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xav...@apache.org
Subject svn commit: r691210 [1/2] - in /ant/ivy/core/trunk: ./ doc/ src/java/org/apache/ivy/core/cache/ src/java/org/apache/ivy/core/deliver/ src/java/org/apache/ivy/core/settings/ src/java/org/apache/ivy/plugins/parser/xml/ src/java/org/apache/ivy/plugins/rep...
Date Tue, 02 Sep 2008 12:07:26 GMT
Author: xavier
Date: Tue Sep  2 05:07:20 2008
New Revision: 691210

URL: http://svn.apache.org/viewvc?rev=691210&view=rev
Log:
IMPROVEMENT: Better and more homogeneous relative paths handling (IVY-387) 

Added:
    ant/ivy/core/trunk/test/repositories/ivysettings-url.xml   (with props)
Removed:
    ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsTest.java
Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/doc/concept.html
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngine.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/file/FileRepository.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/vsftp/VsftpRepository.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/util/Checks.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/util/Configurator.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileResolver.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/util/StringUtils.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/TestHelper.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyArtifactPropertyTest.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-test.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/publish/PublishEngineTest.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/badcacheconf.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/dualchainresolverconf.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/retrieve/RetrieveTest.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ConfigureTest.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivyconf-properties-relative-to-ivyconf.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-cache-invalid.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-cache.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-include-special.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-macro#2.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-macro+ref.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-macro.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-packager.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-ref.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-test.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings.properties
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest-compatible.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest-time-transitivity.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest-time.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-regexp-test.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-strict-test.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/lock/ArtifactLockStrategyTest.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/ChainResolverTest.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java
    ant/ivy/core/trunk/test/repositories/IVY-630/ivysettings.xml
    ant/ivy/core/trunk/test/repositories/branches/ivysettings.xml
    ant/ivy/core/trunk/test/repositories/ivysettings-IVY602.xml
    ant/ivy/core/trunk/test/repositories/ivysettings-IVY843.xml
    ant/ivy/core/trunk/test/repositories/ivysettings-dummydefaultresolver.xml
    ant/ivy/core/trunk/test/repositories/ivysettings-invalidcachepattern.xml
    ant/ivy/core/trunk/test/repositories/ivysettings-nodefaultresolver.xml
    ant/ivy/core/trunk/test/repositories/ivysettings.properties
    ant/ivy/core/trunk/test/repositories/ivysettings.xml
    ant/ivy/core/trunk/test/repositories/m2/ivysettings.xml
    ant/ivy/core/trunk/test/repositories/multi-ivypattern/ivysettings.xml
    ant/ivy/core/trunk/test/repositories/namespace/ivysettings.xml
    ant/ivy/core/trunk/test/repositories/parentPom/ivysettings.xml

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Sep  2 05:07:20 2008
@@ -84,6 +84,7 @@
 - NEW: Add transitive dependency version and branch override mechanism (IVY-784)
 - NEW: Add new packager resolver (IVY-829) (thanks to Archie Cobbs)
 
+- IMPROVEMENT: Better and more homogeneous relative paths handling (IVY-387) 
 - IMPROVEMENT: undeprecate configure task (IVY-849)
 - IMPROVEMENT: Detect missing artifacts on publish asap (IVY-862)
 - IMPROVEMENT: Allow to set the branch at deliver/publish time (IVY-859)

Modified: ant/ivy/core/trunk/doc/concept.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/concept.html?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/doc/concept.html (original)
+++ ant/ivy/core/trunk/doc/concept.html Tue Sep  2 05:07:20 2008
@@ -268,7 +268,18 @@
 
 Once Ivy knows that a revision is changing, it will follow this principle to avoid checking your repository too often: if the module metadata has not changed, it will considered the whole module (including artifacts) as not changed. Even if the module descriptor file has changed, it will check the publication data of the module to see if this is a new publication of the same revision or not. Then if the publication date has changed, it will check the artifacts last modified timestamps, and download them accordingly.
 
-So if you want to use changing revisions, use the [[ant:publish]] task to publish your modules, it will take care of updating the publication date, and everything will work fine. And remember to set checkModified=true" on your resolver too!</textarea>
+So if you want to use changing revisions, use the [[ant:publish]] task to publish your modules, it will take care of updating the publication date, and everything will work fine. And remember to set checkModified=true" on your resolver too!
+<h1><a name="paths">Paths handling</a></h1>
+As a dependency manager, Ivy has a lot of file related operations, which most of the time use paths or path patterns to locate the file on the filesystem.
+
+These paths can obviously be relative or absolute. We recommend to always use absolute paths, so that you don't have to worry about what is the base of your relative paths. Ivy provides some variables which can be used as the base of your absolute paths. For instance, Ivy has a concept of base directory, which is basically the same as for Ant. You have access to this base directory with the ivy.basedir variable. So if you have a path like <code>${ivy.basedir}/ivy.xml</code>, you have an absolute path. In [[settings settings files]], you also have a variable called ivy.settings.dir which points to the directory in which your settings file is located, which makes defining paths relative to this directory very easy.
+
+If you really want to use relative paths, the base directory used to actually locate the file depends on where the relative path is defined:
+<ul>
+<li>In an Ivy file, paths are relative to the Ivy file itself (the only possible path in an Ivy file is for configurations declaration inclusion)</li>
+<li>In settings files, paths for file inclusion (namely properties file loading and settings inclusion) are relative to the directory in which the settings file is located. All other paths must be absolute unless explicitly noted.</li>
+<li>In Ivy Ant tasks and Ivy parameters or options, paths are relative to Ivy base directory, which when called from Ant is the same as your Ant basedir.</li>
+</ul></textarea>
 <script type="text/javascript">xooki.postProcess();</script>
 </body>
 </html>

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java Tue Sep  2 05:07:20 2008
@@ -54,6 +54,7 @@
 import org.apache.ivy.plugins.repository.ResourceHelper;
 import org.apache.ivy.plugins.resolver.DependencyResolver;
 import org.apache.ivy.plugins.resolver.util.ResolvedResource;
+import org.apache.ivy.util.Checks;
 import org.apache.ivy.util.FileUtil;
 import org.apache.ivy.util.Message;
 import org.apache.ivy.util.PropertiesFile;
@@ -343,7 +344,8 @@
         File archive = new File(getRepositoryCacheRoot(), getArchivePathInCache(artifact, origin));
         if (!archive.exists() 
                 && !ArtifactOrigin.isUnknown(origin) && origin.isLocal()) {
-            File original = settings.resolveFile(origin.getLocation());
+            File original = Checks.checkAbsolute(
+                origin.getLocation(), artifact + " origin location");
             if (original.exists()) {
                 return original;
             }
@@ -360,7 +362,7 @@
     private File getArchiveFileInCache(
             Artifact artifact, ArtifactOrigin origin, boolean useOrigin) {
         if (useOrigin && !ArtifactOrigin.isUnknown(origin) && origin.isLocal()) {
-            return settings.resolveFile(origin.getLocation());
+            return Checks.checkAbsolute(origin.getLocation(), artifact + " origin location");
         } else {
             return new File(getRepositoryCacheRoot(), getArchivePathInCache(artifact, origin));
         }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngine.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngine.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngine.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngine.java Tue Sep  2 05:07:20 2008
@@ -174,8 +174,8 @@
         // 4) copy the source resolved ivy to the destination specified,
         // updating status, revision and dependency revisions obtained by
         // PublishingDependencyRevisionResolver
-        String publishedIvy = IvyPatternHelper.substitute(destIvyPattern, md
-                .getResolvedModuleRevisionId());
+        File publishedIvy = settings.resolveFile(
+                    IvyPatternHelper.substitute(destIvyPattern, md.getResolvedModuleRevisionId()));
         Message.info("\tdelivering ivy file to " + publishedIvy);
 
         String[] confs = ConfigurationUtils.replaceWildcards(options.getConfs(), md);
@@ -183,7 +183,7 @@
         confsToRemove.removeAll(Arrays.asList(confs));
 
         try {
-            XmlModuleDescriptorUpdater.update(ivyFileURL, settings.resolveFile(publishedIvy),
+            XmlModuleDescriptorUpdater.update(ivyFileURL, publishedIvy,
                     new UpdateOptions()
                         .setSettings(settings)
                         .setResolvedRevisions(resolvedDependencies)

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java Tue Sep  2 05:07:20 2008
@@ -98,7 +98,7 @@
 import org.apache.ivy.plugins.version.SubVersionMatcher;
 import org.apache.ivy.plugins.version.VersionMatcher;
 import org.apache.ivy.plugins.version.VersionRangeMatcher;
-import org.apache.ivy.util.FileResolver;
+import org.apache.ivy.util.Checks;
 import org.apache.ivy.util.FileUtil;
 import org.apache.ivy.util.Message;
 import org.apache.ivy.util.filter.Filter;
@@ -107,7 +107,7 @@
 public class IvySettings implements SortEngineSettings, PublishEngineSettings, ParserSettings,
         DeliverEngineSettings, CheckEngineSettings, InstallEngineSettings, 
         ResolverSettings, ResolveEngineSettings, RetrieveEngineSettings, 
-        RepositoryManagementEngineSettings, FileResolver {
+        RepositoryManagementEngineSettings {
     private static final long INTERUPT_TIMEOUT = 2000;
 
     private Map typeDefs = new HashMap();
@@ -182,7 +182,7 @@
 
     private File defaultUserDir;
     
-    private File baseDir = new File(".");
+    private File baseDir = new File(".").getAbsoluteFile();
 
     private List classpathURLs = new ArrayList();
 
@@ -215,6 +215,7 @@
     public IvySettings(IvyVariableContainer variableContainer) {
         setVariableContainer(variableContainer);
         setVariable("ivy.default.settings.dir", getDefaultSettingsDir(), true);
+        setVariable("ivy.basedir", getBaseDir().getAbsolutePath());
         setDeprecatedVariable("ivy.default.conf.dir", "ivy.default.settings.dir");
 
         String ivyTypeDefs = System.getProperty("ivy.typedef.files");
@@ -222,7 +223,8 @@
             String[] files = ivyTypeDefs.split("\\,");
             for (int i = 0; i < files.length; i++) {
                 try {
-                    typeDefs(new FileInputStream(resolveFile(files[i].trim())), true);
+                    typeDefs(new FileInputStream(
+                        Checks.checkAbsolute(files[i].trim(), "ivy.typedef.files")), true);
                 } catch (FileNotFoundException e) {
                     Message.warn("typedefs file not found: " + files[i].trim());
                 } catch (IOException e) {
@@ -364,7 +366,8 @@
         long start = System.currentTimeMillis();
         setSettingsVariables(settingsFile);
         if (getVariable("ivy.default.ivy.user.dir") != null) {
-            setDefaultIvyUserDir(resolveFile(getVariable("ivy.default.ivy.user.dir")));
+            setDefaultIvyUserDir(Checks.checkAbsolute(
+                getVariable("ivy.default.ivy.user.dir"), "ivy.default.ivy.user.dir"));
         } else {
             getDefaultIvyUserDir();
         }
@@ -389,7 +392,8 @@
         long start = System.currentTimeMillis();
         setSettingsVariables(settingsURL);
         if (getVariable("ivy.default.ivy.user.dir") != null) {
-            setDefaultIvyUserDir(resolveFile(getVariable("ivy.default.ivy.user.dir")));
+            setDefaultIvyUserDir(Checks.checkAbsolute(
+                getVariable("ivy.default.ivy.user.dir"), "ivy.default.ivy.user.dir"));
         } else {
             getDefaultIvyUserDir();
         }
@@ -411,7 +415,8 @@
      */
     public void defaultInit() throws IOException {
         if (getVariable("ivy.default.ivy.user.dir") != null) {
-            setDefaultIvyUserDir(resolveFile(getVariable("ivy.default.ivy.user.dir")));
+            setDefaultIvyUserDir(Checks.checkAbsolute(
+                    getVariable("ivy.default.ivy.user.dir"), "ivy.default.ivy.user.dir"));
         } else {
             getDefaultIvyUserDir();
         }
@@ -751,7 +756,8 @@
     }
     
     public void setBaseDir(File baseDir) {
-        this.baseDir = baseDir;
+        this.baseDir = baseDir.getAbsoluteFile();
+        setVariable("ivy.basedir", this.baseDir.getAbsolutePath());
     }
     
     public File getBaseDir() {
@@ -761,7 +767,7 @@
     public File getDefaultIvyUserDir() {
         if (defaultUserDir == null) {
             if (getVariable("ivy.home") != null) {
-                setDefaultIvyUserDir(resolveFile(getVariable("ivy.home")));
+                setDefaultIvyUserDir(Checks.checkAbsolute(getVariable("ivy.home"), "ivy.home"));
                 Message.verbose("using ivy.default.ivy.user.dir variable for default ivy user dir: "
                                 + defaultUserDir);
             } else {
@@ -782,7 +788,7 @@
         if (defaultCache == null) {
             String cache = getVariable("ivy.cache.dir");
             if (cache != null) {
-                defaultCache = resolveFile(cache);
+                defaultCache = Checks.checkAbsolute(cache, "ivy.cache.dir");
             } else {
                 setDefaultCache(new File(getDefaultIvyUserDir(), "cache"));
                 Message.verbose("no default cache defined: set to " + defaultCache);
@@ -813,7 +819,7 @@
     public File getDefaultRepositoryCacheBasedir() {
         String repositoryCacheRoot = getVariable("ivy.cache.repository");
         if (repositoryCacheRoot != null) {
-            return resolveFile(repositoryCacheRoot);
+            return Checks.checkAbsolute(repositoryCacheRoot, "ivy.cache.repository");
         } else {
             return getDefaultCache();
         }
@@ -822,7 +828,7 @@
     public File getDefaultResolutionCacheBasedir() {
         String resolutionCacheRoot = getVariable("ivy.cache.resolution");
         if (resolutionCacheRoot != null) {
-            return resolveFile(resolutionCacheRoot);
+            return Checks.checkAbsolute(resolutionCacheRoot, "ivy.cache.resolution");
         } else {
             return getDefaultCache();
         }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java Tue Sep  2 05:07:20 2008
@@ -42,7 +42,9 @@
 import org.apache.ivy.plugins.latest.LatestStrategy;
 import org.apache.ivy.plugins.lock.LockStrategy;
 import org.apache.ivy.plugins.matcher.PatternMatcher;
+import org.apache.ivy.util.Checks;
 import org.apache.ivy.util.Configurator;
+import org.apache.ivy.util.FileResolver;
 import org.apache.ivy.util.Message;
 import org.apache.ivy.util.url.URLHandlerRegistry;
 import org.xml.sax.Attributes;
@@ -130,7 +132,11 @@
 
     public void parse(URL settings) throws ParseException, IOException {
         configurator = new Configurator();
-        configurator.setFileResolver(ivy);
+        configurator.setFileResolver(new FileResolver() {
+            public File resolveFile(String path, String filename) {
+                return Checks.checkAbsolute(path, filename);
+            }
+        });
         // put every type definition from ivy to configurator
         Map typeDefs = ivy.getTypeDefs();
         for (Iterator iter = typeDefs.keySet().iterator(); iter.hasNext();) {
@@ -276,7 +282,7 @@
         
         String cache = (String) attributes.get("defaultCacheDir");
         if (cache != null) {
-            ivy.setDefaultCache(resolveFile(cache));
+            ivy.setDefaultCache(Checks.checkAbsolute(cache, "defaultCacheDir"));
         }
         String up2d = (String) attributes.get("checkUpToDate");
         if (up2d != null) {
@@ -313,7 +319,7 @@
         if (cache != null) {
             Message.deprecated("'defaultCache' is deprecated, "
                 + "use 'caches[@defaultCacheDir]' instead (" + settings + ")");
-            ivy.setDefaultCache(resolveFile(cache));
+            ivy.setDefaultCache(Checks.checkAbsolute(cache, "defaultCache"));
         }
         String defaultBranch = (String) attributes.get("defaultBranch");
         if (defaultBranch != null) {
@@ -385,9 +391,13 @@
             } else {
                 settingsURL = urlFromFileAttribute(propFilePath);
                 Message.verbose("including file: " + settingsURL);
-                ivy.setSettingsVariables(resolveFile(propFilePath));
-                //We can not use the setSettingsVariables(URL) because that would put different
-                //values for the properties.  I'm not sure what would be the regression...
+                if ("file".equals(settingsURL.getProtocol())) {
+                    ivy.setSettingsVariables(
+                        Checks.checkAbsolute(settingsURL.getPath(), 
+                        "settings include path"));
+                } else {
+                    ivy.setSettingsVariables(settingsURL);
+                }
             }
             new XmlSettingsParser(ivy).parse(configurator, settingsURL);
         } finally {
@@ -470,7 +480,7 @@
                 throw new IllegalArgumentException(
                         "either url or file should be given for classpath element");
             } else {
-                url = resolveFile(file).toURI().toURL();
+                url = Checks.checkAbsolute(file, "classpath").toURI().toURL();
             }
         } else {
             url = new URL(urlStr);
@@ -593,8 +603,4 @@
             ivy.setDefaultLockStrategy(strategy);
         }
     }
-
-    private File resolveFile(String filePath) {
-        return ivy.resolveFile(filePath);
-    }
 }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java Tue Sep  2 05:07:20 2008
@@ -50,6 +50,7 @@
 import org.apache.ivy.plugins.repository.Resource;
 import org.apache.ivy.plugins.repository.file.FileResource;
 import org.apache.ivy.plugins.repository.url.URLResource;
+import org.apache.ivy.util.Checks;
 import org.apache.ivy.util.Message;
 import org.apache.ivy.util.XMLHelper;
 import org.apache.ivy.util.extendable.ExtendableItemHelper;
@@ -445,7 +446,7 @@
                         String urlStr = attributes.getValue("url");
                         url = new URL(urlStr);
                     } else {
-                        url = settings.resolveFile(fileName).toURI().toURL();
+                        url = Checks.checkAbsolute(fileName, "settings.include").toURI().toURL();
                     }
                 }
                 XMLHelper.parse(url, null, new DefaultHandler() {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/file/FileRepository.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/file/FileRepository.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/file/FileRepository.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/file/FileRepository.java Tue Sep  2 05:07:20 2008
@@ -26,6 +26,7 @@
 import org.apache.ivy.plugins.repository.RepositoryCopyProgressListener;
 import org.apache.ivy.plugins.repository.Resource;
 import org.apache.ivy.plugins.repository.TransferEvent;
+import org.apache.ivy.util.Checks;
 import org.apache.ivy.util.FileUtil;
 
 public class FileRepository extends AbstractRepository {
@@ -40,7 +41,7 @@
     }
 
     public FileRepository(File basedir) {
-        this.baseDir = basedir;
+        setBaseDir(basedir);
     }
 
     public Resource getResource(String source) throws IOException {
@@ -114,7 +115,7 @@
         if (baseDir != null) {
             return FileUtil.resolveFile(baseDir, source);
         } else {
-            return new File(source);
+            return Checks.checkAbsolute(source, "source");
         }
     }
 
@@ -130,7 +131,8 @@
         return baseDir;
     }
     
-    public void setBaseDir(File baseDir) {
+    public final void setBaseDir(File baseDir) {
+        Checks.checkAbsolute(baseDir, "basedir");
         this.baseDir = baseDir;
     }
 }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/vsftp/VsftpRepository.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/vsftp/VsftpRepository.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/vsftp/VsftpRepository.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/vsftp/VsftpRepository.java Tue Sep  2 05:07:20 2008
@@ -38,6 +38,7 @@
 import org.apache.ivy.plugins.repository.BasicResource;
 import org.apache.ivy.plugins.repository.Resource;
 import org.apache.ivy.plugins.repository.TransferEvent;
+import org.apache.ivy.util.Checks;
 import org.apache.ivy.util.Message;
 
 /**
@@ -152,7 +153,7 @@
             int index = source.lastIndexOf('/');
             String srcName = index == -1 ? source : source.substring(index + 1);
             final File to = destDir == null 
-                    ? ivy.getSettings().resolveFile(srcName) : new File(destDir, srcName);
+                    ? Checks.checkAbsolute(srcName, "source") : new File(destDir, srcName);
 
             final IOException[] ex = new IOException[1];
             Thread get = new IvyThread() {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/FileSystemResolver.java Tue Sep  2 05:07:20 2008
@@ -30,7 +30,9 @@
 import org.apache.ivy.core.IvyPatternHelper;
 import org.apache.ivy.core.module.descriptor.Artifact;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
+import org.apache.ivy.core.settings.IvyPattern;
 import org.apache.ivy.plugins.repository.file.FileRepository;
+import org.apache.ivy.util.Checks;
 import org.apache.ivy.util.Message;
 
 /**
@@ -78,14 +80,6 @@
         setRepository(new FileRepository());
     }
     
-    public void setSettings(ResolverSettings settings) {
-        super.setSettings(settings);
-        FileRepository fileRepository = getFileRepository();
-        if (fileRepository.getBaseDir() == null) {
-            fileRepository.setBaseDir(settings.getBaseDir());
-        }
-    }
-
     public String getTypeName() {
         return "file";
     }
@@ -284,13 +278,13 @@
     }
 
     private void initTransaction(ModuleRevisionId module) {
-        transactionTempDir = getSettings().resolveFile(IvyPatternHelper.substitute(
+        transactionTempDir = Checks.checkAbsolute(IvyPatternHelper.substitute(
             baseTransactionPattern, 
             ModuleRevisionId.newInstance(
-                module, module.getRevision() + TRANSACTION_DESTINATION_SUFFIX)));
-        transactionDestDir = getSettings().resolveFile(IvyPatternHelper.substitute(
-            baseTransactionPattern, 
-            module));
+                module, module.getRevision() + TRANSACTION_DESTINATION_SUFFIX)),
+                "baseTransactionPattern");
+        transactionDestDir = Checks.checkAbsolute(IvyPatternHelper.substitute(
+            baseTransactionPattern, module), "baseTransactionPattern");
     }
 
     public String getTransactional() {
@@ -301,4 +295,23 @@
         this.transactional = transactional;
     }
 
+    public void addConfiguredIvy(IvyPattern p) {
+        Checks.checkAbsolute(p.getPattern(), "ivy pattern");
+        super.addConfiguredIvy(p);
+    }
+    
+    public void addIvyPattern(String pattern) {
+        Checks.checkAbsolute(pattern, "ivy pattern");
+        super.addIvyPattern(pattern);
+    }
+    
+    public void addConfiguredArtifact(IvyPattern p) {
+        Checks.checkAbsolute(p.getPattern(), "artifact pattern");
+        super.addConfiguredArtifact(p);
+    }
+    
+    public void addArtifactPattern(String pattern) {
+        Checks.checkAbsolute(pattern, "artifact pattern");
+        super.addArtifactPattern(pattern);
+    }
 }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/Checks.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/Checks.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/Checks.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/Checks.java Tue Sep  2 05:07:20 2008
@@ -17,6 +17,8 @@
  */
 package org.apache.ivy.util;
 
+import java.io.File;
+
 /**
  * Utility class used to perform some checks.
  */
@@ -40,4 +42,20 @@
         }
     }
 
+    public static File checkAbsolute(File f, String fileName) {
+        checkNotNull(f, fileName);
+        if (!f.isAbsolute()) {
+            throw new IllegalArgumentException(fileName + " must be absolute: " + f.getPath());
+        }
+        return f;
+    }
+    
+    public static File checkAbsolute(String path, String fileName) {
+        checkNotNull(path, fileName);
+        File f = new File(path);
+        if (!f.isAbsolute()) {
+            throw new IllegalArgumentException(fileName + " must be absolute: " + path);
+        }
+        return f;
+    }
 }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/Configurator.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/Configurator.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/Configurator.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/Configurator.java Tue Sep  2 05:07:20 2008
@@ -641,7 +641,8 @@
             } else if (paramClass.equals(Class.class)) {
                 convertedValue = Class.forName(value);
             } else if (paramClass.equals(File.class)) {
-                convertedValue = fileResolver.resolveFile(value);
+                convertedValue = fileResolver.resolveFile(
+                                        value, od.getObjectName() + "." + attributeName);
             } else {
                 convertedValue = paramClass.getConstructor(new Class[] {String.class}).newInstance(
                     new Object[] {value});
@@ -711,7 +712,8 @@
         } catch (Exception ex) {
             IllegalArgumentException iae = new IllegalArgumentException(
                     "impossible to add configured child for " + name + " on "
-                            + parentOD.getObject().getClass());
+                            + parentOD.getObject().getClass() 
+                            + ": " + StringUtils.getErrorMessage(ex));
             iae.initCause(ex);
             throw iae;
         }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileResolver.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileResolver.java Tue Sep  2 05:07:20 2008
@@ -21,22 +21,24 @@
 
 public interface FileResolver {
     public static final FileResolver DEFAULT = new FileResolver() {
-        public File resolveFile(String filename) {
+        public File resolveFile(String path, String filename) {
             return new File(filename);
         }
     };
     
     /**
-     * Return the canonical form of a filename.
+     * Return the canonical form of a path, or raise an {@link IllegalArgumentException} if the path
+     * is not valid for this {@link FileResolver}.
      * <p>
-     * If the specified file name is relative it is resolved
-     * with respect to the settings's base directory.
-     *
-     * @param fileName The name of the file to resolve.
-     *                 Must not be <code>null</code>.
-     *
+     * 
+     * @param path
+     *            The path of the file to resolve. Must not be <code>null</code>.
+     * @param fileName
+     *            The name of the file to resolve. This is used only for exception message if any.
+     *            Must not be <code>null</code>.
+     * 
      * @return the resolved File.
-     *
+     * 
      */
-    File resolveFile(String filename);
+    File resolveFile(String path, String filename);
 }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/StringUtils.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/StringUtils.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/StringUtils.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/StringUtils.java Tue Sep  2 05:07:20 2008
@@ -19,6 +19,7 @@
 
 import java.io.ByteArrayOutputStream;
 import java.io.PrintWriter;
+import java.lang.reflect.InvocationTargetException;
 import java.util.Locale;
 
 /**
@@ -42,21 +43,25 @@
     }
     
     /**
-     * Returns the error message associated with the given exception. Th error message returned will
-     * try to be as precise as possible, handling cases where e.getMessage() is not meaningful, like
-     * {@link NullPointerException} for instance.
+     * Returns the error message associated with the given Throwable. The error message returned
+     * will try to be as precise as possible, handling cases where e.getMessage() is not meaningful,
+     * like {@link NullPointerException} for instance.
      * 
-     * @param e
-     *            the exception to get the error message from
+     * @param t
+     *            the throwable to get the error message from
      * @return the error message of the given exception
      */
-    public static String getErrorMessage(Exception e) {
-        if (e == null) {
+    public static String getErrorMessage(Throwable t) {
+        if (t == null) {
             return "";
         }
-        String errMsg = e instanceof RuntimeException ? e.getMessage() : e.toString();
+        if (t instanceof InvocationTargetException) {
+            InvocationTargetException ex = (InvocationTargetException) t;
+            t = ex.getTargetException();
+        }
+        String errMsg = t instanceof RuntimeException ? t.getMessage() : t.toString();
         if (errMsg == null || errMsg.length() == 0 || "null".equals(errMsg)) {
-            errMsg = e.getClass().getName() + " at " + e.getStackTrace()[0].toString();
+            errMsg = t.getClass().getName() + " at " + t.getStackTrace()[0].toString();
         }
         return errMsg;
     }

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/TestHelper.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/TestHelper.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/TestHelper.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/TestHelper.java Tue Sep  2 05:07:20 2008
@@ -254,10 +254,11 @@
     public static FileSystemResolver newTestRepository() {
         FileSystemResolver testRepository = new FileSystemResolver();
         testRepository.setName("test");
+        String testRepoDir = new File("build/test/test-repo").getAbsolutePath();
         testRepository.addIvyPattern(
-            "build/test/test-repo/[organisation]/[module]/[revision]/[artifact].[ext]");
+            testRepoDir + "/[organisation]/[module]/[revision]/[artifact].[ext]");
         testRepository.addArtifactPattern(
-            "build/test/test-repo/[organisation]/[module]/[revision]/[artifact].[ext]");
+            testRepoDir + "/[organisation]/[module]/[revision]/[artifact].[ext]");
         return testRepository;
     }
 

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyArtifactPropertyTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyArtifactPropertyTest.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyArtifactPropertyTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyArtifactPropertyTest.java Tue Sep  2 05:07:20 2008
@@ -65,7 +65,8 @@
         prop.execute();
         String val = project.getProperty("mod1.2.mod1.2-2.0");
         assertNotNull(val);
-        assertEquals("build/cache/mod1.2/mod1.2-2.0.jar", val);
+        assertEquals(new File("build/cache/mod1.2/mod1.2-2.0.jar").getCanonicalPath(), 
+                    new File(val).getCanonicalPath());
     }
 
     public void testWithResolveId() throws Exception {
@@ -88,7 +89,8 @@
 
         String val = project.getProperty("mod1.2.mod1.2-2.0");
         assertNotNull(val);
-        assertEquals("build/cache/mod1.2/mod1.2-2.0.jar", val);
+        assertEquals(new File("build/cache/mod1.2/mod1.2-2.0.jar").getCanonicalPath(), 
+            new File(val).getCanonicalPath());
     }
 
     public void testWithResolveIdWithoutResolve() throws Exception {

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java Tue Sep  2 05:07:20 2008
@@ -30,40 +30,37 @@
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.types.Reference;
 
-/**
- * Test the deprecated IvyConfigureTest and the underlying implementation AntIvySettings. When
- * IvyConfigure will be removed, this class should be renamed AntIvySettingsTest
- */
 public class IvyConfigureTest extends TestCase {
-    private IvyConfigure antSettings;
+    private IvyConfigure configure;
+    private Project project;
 
     protected void setUp() throws Exception {
-        Project project = new Project();
+        project = new Project();
         project.setProperty("myproperty", "myvalue");
 
-        antSettings = new IvyConfigure();
-        antSettings.setProject(project);
+        configure = new IvyConfigure();
+        configure.setProject(project);
     }
-
+    
     private Ivy getIvyInstance() {
         IvyTask task = new IvyTask() {
             public void doExecute() throws BuildException {
             }};
-        task.setProject(antSettings.getProject());
+        task.setProject(project);
         task.init();
         
-        Reference ref = new Reference(antSettings.getSettingsId());
-//        ref.setProject(antSettings.getProject());
+        Reference ref = new Reference(configure.getSettingsId());
+//        ref.setProject(project);
         task.setSettingsRef(ref);
         return task.getIvyInstance();
     }
 
     public void testDefault() throws Exception {
-        // by default configure look in the current directory for an ivysettings.xml file...
+        // by default settings look in the current directory for an ivysettings.xml file...
         // but Ivy itself has one, and we don't want to use it
-        antSettings.getProject()
+        configure.getProject()
                 .setProperty("ivy.settings.file", "no/settings/will/use/default.xml");
-        antSettings.execute();
+        configure.execute();
 
         IvySettings settings = getIvyInstance().getSettings();
         assertNotNull(settings.getDefaultResolver());
@@ -76,12 +73,12 @@
     }
 
     public void testDefault14() throws Exception {
-        // by default configure look in the current directory for an ivysettings.xml file...
+        // by default settings look in the current directory for an ivysettings.xml file...
         // but Ivy itself has one, and we don't want to use it
-        antSettings.getProject()
+        configure.getProject()
                 .setProperty("ivy.settings.file", "no/settings/will/use/default.xml");
-        antSettings.getProject().setProperty("ivy.14.compatible", "true");
-        antSettings.execute();
+        configure.getProject().setProperty("ivy.14.compatible", "true");
+        configure.execute();
 
         IvySettings settings = getIvyInstance().getSettings();
         assertNotNull(settings.getDefaultResolver());
@@ -91,9 +88,9 @@
     }
 
     public void testFile() throws Exception {
-        antSettings.setFile(new File("test/repositories/ivysettings.xml"));
+        configure.setFile(new File("test/repositories/ivysettings.xml"));
 
-        antSettings.execute();
+        configure.execute();
 
         Ivy ivy = getIvyInstance();
         assertNotNull(ivy);
@@ -110,16 +107,15 @@
         assertEquals("myvalue", settings.getVariables().getVariable("myproperty"));
     }
 
-    /*@SuppressWarnings*/
     public void testURL() throws Exception {
-        String confUrl = new File("test/repositories/ivysettings.xml").toURL().toExternalForm();
+        String confUrl = new File("test/repositories/ivysettings-url.xml").toURL().toExternalForm();
         String confDirUrl = new File("test/repositories").toURL().toExternalForm();
         if (confDirUrl.endsWith("/")) {
             confDirUrl = confDirUrl.substring(0, confDirUrl.length() - 1);
         }
-        antSettings.setUrl(confUrl);
+        configure.setUrl(confUrl);
 
-        antSettings.execute();
+        configure.execute();
 
         IvySettings settings = getIvyInstance().getSettings();
 
@@ -132,45 +128,118 @@
     public void testAntProperties() throws Exception {
         String confUrl = IvyConfigureTest.class.getResource("ivysettings-test.xml")
                 .toExternalForm();
-        antSettings.setUrl(confUrl);
+        configure.setUrl(confUrl);
 
-        antSettings.execute();
+        configure.execute();
 
         IvySettings settings = getIvyInstance().getSettings();
         assertNotNull(settings);
 
         assertEquals("myvalue", settings.getVariables().getVariable("myproperty"));
-        assertEquals("myvalue", settings.getDefaultCache().getName());
+        assertEquals("myvalue", settings.getDefaultResolver().getName());
+    }
+
+    public void testOverrideVariables() throws Exception {
+        String confUrl = IvyConfigureTest.class.getResource("ivysettings-props.xml")
+                .toExternalForm();
+        configure.setUrl(confUrl);
+
+        configure.execute();
+
+        IvySettings settings = getIvyInstance().getSettings();
+        assertNotNull(settings);
+
+        assertEquals("lib/test/[artifact]-[revision].[ext]", 
+            settings.getVariables().getVariable("ivy.retrieve.pattern"));
     }
 
     public void testExposeAntProperties() throws Exception {
         String confUrl = IvyConfigureTest.class.getResource("ivysettings-props.xml")
                 .toExternalForm();
-        antSettings.setUrl(confUrl);
+        configure.setUrl(confUrl);
+        configure.setSettingsId("this.id");
         
-        antSettings.execute();
+        configure.execute();
 
         assertNotNull(getIvyInstance());
 
         assertEquals("value", 
-            antSettings.getProject().getProperty("ivy.test.variable"));
+            configure.getProject().getProperty("ivy.test.variable"));
+        assertEquals("value", 
+            configure.getProject().getProperty("ivy.test.variable.this.id"));
+    }
 
-        assertEquals(getIvyInstance().getSettings().getDefaultCache().getAbsolutePath(), 
-            antSettings.getProject().getProperty("ivy.cache.dir"));
+    public void testIncludeTwice() throws Exception {
+        // IVY-601
+        configure.setFile(new File("test/java/org/apache/ivy/ant/ivysettings-include-twice.xml"));
+        
+        configure.execute();
+
+        assertNotNull(getIvyInstance());
     }
 
-    public void testOverrideVariables() throws Exception {
-        String confUrl = IvyConfigureTest.class.getResource("ivysettings-props.xml")
-                .toExternalForm();
-        antSettings.setUrl(confUrl);
+    public void testOverrideTrue() throws Exception {
+        configure.setFile(new File("test/repositories/ivysettings.xml"));
+        configure.execute();
+
+        Ivy ivy = getIvyInstance();
+        assertNotNull(ivy);
 
-        antSettings.execute();
+        configure = new IvyConfigure();
+        configure.setProject(project);
+        configure.setOverride("true");
+        configure.setFile(new File("test/repositories/ivysettings.xml"));
+        configure.execute();
+        assertNotNull(getIvyInstance());
+        
+        assertTrue(ivy != getIvyInstance());
+    }
 
-        IvySettings settings = getIvyInstance().getSettings();
-        assertNotNull(settings);
+    public void testOverrideFalse() throws Exception {
+        configure.setFile(new File("test/repositories/ivysettings.xml"));
+        configure.execute();
 
-        assertEquals("lib/test/[artifact]-[revision].[ext]", 
-            settings.getVariables().getVariable("ivy.retrieve.pattern"));
+        Ivy ivy = getIvyInstance();
+        assertNotNull(ivy);
+
+        IvyConfigure newAntSettings = new IvyConfigure();
+        newAntSettings.setProject(project);
+        newAntSettings.setOverride("false");
+        newAntSettings.setFile(new File("test/repositories/ivysettings.xml"));
+        newAntSettings.execute();
+        
+        assertTrue(ivy == getIvyInstance());
+    }
+
+    public void testOverrideNotAllowed() throws Exception {
+        configure.setFile(new File("test/repositories/ivysettings.xml"));
+        configure.execute();
+
+        Ivy ivy = getIvyInstance();
+        assertNotNull(ivy);
+
+        configure = new IvyConfigure();
+        configure.setProject(project);
+        configure.setOverride("notallowed");
+        configure.setFile(new File("test/repositories/ivysettings.xml"));
+        
+        try {
+            configure.execute();
+            fail("calling settings twice with the same id with "
+                    + "override=notallowed should raise an exception");
+        } catch (BuildException e) {
+            assertTrue(e.getMessage().indexOf("notallowed") != -1);
+            assertTrue(e.getMessage().indexOf(configure.getSettingsId()) != -1);
+        }
+    }
+
+    public void testInvalidOverride() throws Exception {
+        try {
+            configure.setOverride("unknown");
+            fail("settings override with invalid value should raise an exception");
+        } catch (Exception e) {
+            assertTrue(e.getMessage().indexOf("unknown") != -1);
+        }
     }
 
 }

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java Tue Sep  2 05:07:20 2008
@@ -62,7 +62,7 @@
     
     public void testIVY779() throws Exception {
         Project project = new Project();
-        project.setProperty("ivy.local.default.root", "test/repositories/norev");
+        project.setProperty("ivy.local.default.root", new File("test/repositories/norev").getAbsolutePath());
         project.setProperty("ivy.local.default.ivy.pattern", "[module]/[artifact].[ext]");
         project.setProperty("ivy.local.default.artifact.pattern", "[module]/[artifact].[ext]");
 

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-test.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-test.xml?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-test.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-test.xml Tue Sep  2 05:07:20 2008
@@ -17,13 +17,13 @@
    under the License.    
 -->
 <ivysettings>
-	<settings defaultCache="${myproperty}" defaultResolver="test"/>
+	<settings defaultResolver="${myproperty}"/>
 	<resolvers>
-		<filesystem name="test">
-			<ivy pattern="${ivy.settings.dir}/1/[organisation]/[module]/ivys/ivy-[revision].xml"/>
-			<artifact pattern="${ivy.settings.dir}/1/[organisation]/[module]/[type]s/[artifact]-[revision].[type]"/>
-			<ivy pattern="${ivy.settings.dir}/2/[module]/ivy-[revision].xml"/>
-			<artifact pattern="${ivy.settings.dir}/2/[module]/[artifact]-[revision].[type]"/>
+		<filesystem name="${myproperty}">
+			<ivy pattern="${ivy.basedir}/1/[organisation]/[module]/ivys/ivy-[revision].xml"/>
+			<artifact pattern="${ivy.basedir}/1/[organisation]/[module]/[type]s/[artifact]-[revision].[type]"/>
+			<ivy pattern="${ivy.basedir}/2/[module]/ivy-[revision].xml"/>
+			<artifact pattern="${ivy.basedir}/2/[module]/[artifact]-[revision].[type]"/>
 		</filesystem>
 	</resolvers>
 </ivysettings>

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/publish/PublishEngineTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/publish/PublishEngineTest.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/publish/PublishEngineTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/publish/PublishEngineTest.java Tue Sep  2 05:07:20 2008
@@ -24,7 +24,6 @@
 
 import junit.framework.TestCase;
 
-import org.apache.ivy.core.cache.DefaultResolutionCacheManager;
 import org.apache.ivy.core.event.EventManager;
 import org.apache.ivy.core.module.descriptor.Artifact;
 import org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor;
@@ -70,8 +69,9 @@
         };
         resolver.setName("test");
         resolver.setSettings(settings);
-        resolver.addIvyPattern("build/test/publish/repo/[module]/[revision]/[artifact].[ext]");
-        resolver.addArtifactPattern("build/test/publish/repo/[module]/[revision]/[artifact].[ext]");
+        String publishRepoDir = new File("build/test/publish/repo").getAbsolutePath();
+        resolver.addIvyPattern(publishRepoDir + "/[module]/[revision]/[artifact].[ext]");
+        resolver.addArtifactPattern(publishRepoDir + "/[module]/[revision]/[artifact].[ext]");
         
         FileUtil.copy(
             new File("test/repositories/1/org1/mod1.1/jars/mod1.1-1.0.jar"), 

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java Tue Sep  2 05:07:20 2008
@@ -632,11 +632,13 @@
         resolver.setName("dual");
         FileSystemResolver r = new FileSystemResolver();
         r.setName("1");
-        r.addArtifactPattern("build/testCache2/[artifact]-[revision].[ext]");
+        r.addArtifactPattern(settings.getBaseDir().getPath() 
+            + "/build/testCache2/[artifact]-[revision].[ext]");
         resolver.add(r);
         r = new FileSystemResolver();
         r.setName("2");
-        r.addArtifactPattern("build/testCache2/[artifact]-[revision].[ext]");
+        r.addArtifactPattern(settings.getBaseDir().getPath() 
+            + "/build/testCache2/[artifact]-[revision].[ext]");
         resolver.add(r);
         ivy.getSettings().addResolver(resolver);
         ivy.getSettings().setDefaultResolver("dual");

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/badcacheconf.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/badcacheconf.xml?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/badcacheconf.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/badcacheconf.xml Tue Sep  2 05:07:20 2008
@@ -17,11 +17,11 @@
    under the License.    
 -->
 <ivysettings>
-  <conf defaultCache="build/cache" defaultResolver="default"/>
+  <conf defaultCache="${ivy.basedir}/build/cache" defaultResolver="default"/>
   <resolvers>
 	<filesystem name="default">
-		<ivy pattern="build/cache/[organisation]/[module]/ivy-[revision].xml" />
-		<artifact pattern="[organisation]/[module]/[type]s/[artifact]-[revision].[ext]" />
+		<ivy pattern="${ivy.basedir}/build/cache/[organisation]/[module]/ivy-[revision].xml" />
+		<artifact pattern="${ivy.basedir}/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]" />
 	</filesystem>
   </resolvers>
 </ivysettings>

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/dualchainresolverconf.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/dualchainresolverconf.xml?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/dualchainresolverconf.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/dualchainresolverconf.xml Tue Sep  2 05:07:20 2008
@@ -17,23 +17,23 @@
    under the License.    
 -->
 <ivysettings>
-  <conf defaultCache="build/cache" defaultResolver="default"/>
+  <conf defaultCache="${ivy.basedir}/build/cache" defaultResolver="default"/>
   <resolvers>
     <dual name="default">
 		<chain name="ivyfiles">
 			<filesystem name="localivy">
-				<ivy pattern="test/repositories/dual-local/[organisation]/[module]/ivy-[revision].xml" />
+				<ivy pattern="${ivy.basedir}/test/repositories/dual-local/[organisation]/[module]/ivy-[revision].xml" />
 			</filesystem>
 			<filesystem name="remoteivy">
-				<ivy pattern="test/repositories/dual-remote/[module]/ivy-[revision].xml" />
+				<ivy pattern="${ivy.basedir}/test/repositories/dual-remote/[module]/ivy-[revision].xml" />
 			</filesystem>
 		</chain>
 		<chain name="artifacts">
 			<filesystem name="localartifacts">
-				<artifact pattern="test/repositories/dual-local/[organisation]/[module]/[artifact]-[revision].[type]" />
+				<artifact pattern="${ivy.basedir}/test/repositories/dual-local/[organisation]/[module]/[artifact]-[revision].[type]" />
 			</filesystem>
 			<filesystem name="remoteartifacts">
-				<artifact pattern="test/repositories/dual-remote/[module]/[artifact]-[revision].[type]" />
+				<artifact pattern="${ivy.basedir}/test/repositories/dual-remote/[module]/[artifact]-[revision].[type]" />
 			</filesystem>
 		</chain>
     </dual>

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/retrieve/RetrieveTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/retrieve/RetrieveTest.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/retrieve/RetrieveTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/retrieve/RetrieveTest.java Tue Sep  2 05:07:20 2008
@@ -151,14 +151,14 @@
 
         // we create a fake old file to see if it is overwritten
         File file = new File(IvyPatternHelper.substitute(pattern, "org1", "mod1.2", "2.0",
-            "mod1.2", "jar", "jar", "default"));
+            "mod1.2", "jar", "jar", "default")).getCanonicalFile();
         file.getParentFile().mkdirs();
         file.createNewFile();
-        file.setLastModified(10000);
+        ivy.getSettings().setCheckUpToDate(false);
         ivy.retrieve(md.getModuleRevisionId(), pattern, getRetrieveOptions());
         assertEquals(
-            new File("test/repositories/1/org1/mod1.2/jars/mod1.2-2.0.jar").lastModified(), file
-                    .lastModified());
+            new File("test/repositories/1/org1/mod1.2/jars/mod1.2-2.0.jar").lastModified(), 
+            file.lastModified());
     }
 
     public void testRetrieveWithSymlinks() throws Exception {

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ConfigureTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ConfigureTest.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ConfigureTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ConfigureTest.java Tue Sep  2 05:07:20 2008
@@ -68,7 +68,7 @@
     public void testTypedefWithCustomClasspathWithFile() throws Exception {
         Ivy ivy = new Ivy();
         ivy.setVariable("ivy.custom.test.dir", new File("test/java/org/apache/ivy/core/settings")
-                .toString());
+                .getAbsolutePath());
         ivy.configure(ConfigureTest.class.getResource("ivysettings-custom-typedef2.xml"));
 
         DependencyResolver custom = ivy.getSettings().getResolver("custom");

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java Tue Sep  2 05:07:20 2008
@@ -18,6 +18,7 @@
 package org.apache.ivy.core.settings;
 
 import java.io.File;
+import java.io.IOException;
 import java.text.ParseException;
 import java.util.List;
 
@@ -83,7 +84,7 @@
         List ivyPatterns = fsres.getIvyPatterns();
         assertNotNull(ivyPatterns);
         assertEquals(1, ivyPatterns.size());
-        assertEquals("lib/[organisation]/[module]/ivys/ivy-[revision].xml", ivyPatterns.get(0));
+        assertLocationEquals("lib/[organisation]/[module]/ivys/ivy-[revision].xml", ivyPatterns.get(0));
 
         LatestStrategy strategy = fsres.getLatestStrategy();
         assertNotNull(strategy);
@@ -99,7 +100,7 @@
         FileSystemResolver fsInt1 = (FileSystemResolver) subresolvers.get(0);
         assertEquals("int1", fsInt1.getName());
         assertEquals(1, fsInt1.getIvyPatterns().size());
-        assertEquals("sharedrep/[organisation]/[module]/ivys/ivy-[revision].xml", fsInt1
+        assertLocationEquals("sharedrep/[organisation]/[module]/ivys/ivy-[revision].xml", fsInt1
                 .getIvyPatterns().get(0));
         assertEquals("int2", ((DependencyResolver) subresolvers.get(1)).getName());
 
@@ -298,8 +299,7 @@
         List ivyPatterns = fsInt1.getIvyPatterns();
         assertNotNull(ivyPatterns);
         assertEquals(1, ivyPatterns.size());
-        assertEquals("sharedrep/[organisation]/[module]/ivys/ivy-[revision].xml", ivyPatterns
-                .get(0));
+        assertLocationEquals("sharedrep/[organisation]/[module]/ivys/ivy-[revision].xml", ivyPatterns.get(0));
 
         DependencyResolver external = settings.getResolver("external");
         assertNotNull(external);
@@ -314,8 +314,7 @@
         ivyPatterns = fsInt2.getIvyPatterns();
         assertNotNull(ivyPatterns);
         assertEquals(1, ivyPatterns.size());
-        assertEquals("sharedrep/[organisation]/[module]/ivys/ivy-[revision].xml", ivyPatterns
-                .get(0));
+        assertLocationEquals("sharedrep/[organisation]/[module]/ivys/ivy-[revision].xml", ivyPatterns.get(0));
     }
 
     public void testMacro() throws Exception {
@@ -336,7 +335,7 @@
         List ivyPatterns = fsInt1.getIvyPatterns();
         assertNotNull(ivyPatterns);
         assertEquals(1, ivyPatterns.size());
-        assertEquals("path/to/myrep/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]",
+        assertLocationEquals("path/to/myrep/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]",
             ivyPatterns.get(0));
 
         FileSystemResolver fsInt2 = (FileSystemResolver) subresolvers.get(1);
@@ -345,7 +344,7 @@
         ivyPatterns = fsInt2.getIvyPatterns();
         assertNotNull(ivyPatterns);
         assertEquals(1, ivyPatterns.size());
-        assertEquals("path/to/secondrep/[organisation]/[module]/[type]s/ivy-[revision].xml",
+        assertLocationEquals("path/to/secondrep/[organisation]/[module]/[type]s/ivy-[revision].xml",
             ivyPatterns.get(0));
 
         DependencyResolver other = settings.getResolver("other");
@@ -362,7 +361,7 @@
         ivyPatterns = fsInt2.getIvyPatterns();
         assertNotNull(ivyPatterns);
         assertEquals(1, ivyPatterns.size());
-        assertEquals("path/to/secondrep/[module]/[type]s/ivy-[revision].xml", ivyPatterns.get(0));
+        assertLocationEquals("path/to/secondrep/[module]/[type]s/ivy-[revision].xml", ivyPatterns.get(0));
     }
 
     public void testMacroAndRef() throws Exception {
@@ -426,7 +425,7 @@
         List ivyPatterns = fsInt1.getIvyPatterns();
         assertNotNull(ivyPatterns);
         assertEquals(1, ivyPatterns.size());
-        assertEquals("path/to/myrep/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]",
+        assertLocationEquals("path/to/myrep/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]",
             ivyPatterns.get(0));
 
         DependencyResolver inc = settings.getResolver("includeworks");
@@ -443,7 +442,7 @@
         ivyPatterns = fsInt1.getIvyPatterns();
         assertNotNull(ivyPatterns);
         assertEquals(1, ivyPatterns.size());
-        assertEquals("included/myrep/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]",
+        assertLocationEquals("included/myrep/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]",
             ivyPatterns.get(0));
         
         // properties defined in included file should be available to including file (IVY-780)
@@ -495,7 +494,7 @@
         List ivyPatterns = fsInt1.getIvyPatterns();
         assertNotNull(ivyPatterns);
         assertEquals(1, ivyPatterns.size());
-        assertEquals("path/to/myrep/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]",
+        assertLocationEquals("path/to/myrep/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]",
             ivyPatterns.get(0));
 
         DependencyResolver inc = settings.getResolver("includeworks");
@@ -512,7 +511,7 @@
         ivyPatterns = fsInt1.getIvyPatterns();
         assertNotNull(ivyPatterns);
         assertEquals(1, ivyPatterns.size());
-        assertEquals("included/myrep/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]",
+        assertLocationEquals("included/myrep/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]",
             ivyPatterns.get(0));
         
         // properties defined in included file should be available to including file (IVY-780)
@@ -525,7 +524,7 @@
         parser.parse(XmlSettingsParser.class
                 .getResource("ivyconf-properties-relative-to-ivyconf.xml"));
 
-        assertEquals("lib", settings.getVariable("libraries.dir"));
+        assertLocationEquals("lib", settings.getVariable("libraries.dir"));
     }
     
     public void testParser() throws Exception {
@@ -592,4 +591,9 @@
         public void unlockArtifact(Artifact artifact, File artifactFileToDownload) {
         }
     }
+
+    private void assertLocationEquals(String expected, Object pattern) throws IOException {
+        assertEquals(new File(expected).getCanonicalFile(), 
+                    new File((String) pattern).getCanonicalFile());
+    }
 }

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivyconf-properties-relative-to-ivyconf.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivyconf-properties-relative-to-ivyconf.xml?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivyconf-properties-relative-to-ivyconf.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivyconf-properties-relative-to-ivyconf.xml Tue Sep  2 05:07:20 2008
@@ -20,7 +20,7 @@
 	<!-- properties file is relative to ivyconf.xml - ie this file -->
 	<properties file="ivysettings.properties"/>
 	
-	<conf defaultCache="mycache" defaultResolver="libraries"	validate="false"
+	<conf defaultCache="${ivy.basedir}/mycache" defaultResolver="libraries"	validate="false"
 	   checkUpToDate="false" cacheIvyPattern="[module]/ivys/ivy-[revision].xml"
 	   cacheArtifactPattern="[module]/[type]s/[artifact]-[revision].[ext]"/>
 	   

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-cache-invalid.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-cache-invalid.xml?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-cache-invalid.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-cache-invalid.xml Tue Sep  2 05:07:20 2008
@@ -17,6 +17,7 @@
    under the License.    
 -->
 <ivysettings>
+	<properties file="ivysettings.properties"/>
 	<caches default="mycache2">
 		<cache name="mycache2" />
 	</caches>

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-cache.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-cache.xml?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-cache.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-cache.xml Tue Sep  2 05:07:20 2008
@@ -17,14 +17,15 @@
    under the License.    
 -->
 <ivysettings>
-	<caches default="mycache2" resolutionCacheDir="resolution"
-	        repositoryCacheDir="repository" 
+	<properties file="ivysettings.properties"/>
+	<caches default="mycache2" resolutionCacheDir="${ivy.basedir}/resolution"
+	        repositoryCacheDir="${ivy.basedir}/repository" 
 	        ivyPattern="[module]/ivys/ivy-[revision].xml" 
 	        artifactPattern="[module]/[type]s/[artifact]-[revision].[ext]"
 	        useOrigin="true"
 			lockStrategy="artifact-lock">
 		<cache name="mycache" 
-				basedir="mycache"
+				basedir="${ivy.basedir}/mycache"
 				ivyPattern="[module]/ivy-[revision].xml" 
 				artifactPattern="[module]/[artifact]-[revision].[ext]"
 				useOrigin="false"

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-include-special.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-include-special.xml?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-include-special.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-include-special.xml Tue Sep  2 05:07:20 2008
@@ -19,6 +19,7 @@
 <ivysettings>
 	<include file="ivysettings-macro#2.xml"/>
 	<resolvers>
-		<mymacro name="includeworks" mymainrep="included/myrep" mysecondrep="included/secondrep"/>
+		<mymacro name="includeworks" mymainrep="${ivy.basedir}/included/myrep" 
+		                             mysecondrep="${ivy.basedir}/included/secondrep"/>
 	</resolvers>
 </ivysettings>

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-macro#2.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-macro%232.xml?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-macro#2.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-macro#2.xml Tue Sep  2 05:07:20 2008
@@ -35,10 +35,11 @@
 	</macrodef>
 	
 	<resolvers>
-		<mymacro name="default" mymainrep="path/to/myrep" mysecondrep="path/to/secondrep"/>
+		<mymacro name="default" mymainrep="${ivy.basedir}/path/to/myrep" 
+		                        mysecondrep="${ivy.basedir}/path/to/secondrep"/>
 		<mymacro name="other" 
-					mymainrep="path/to/myrep" 
-					mysecondrep="path/to/secondrep" 
+					mymainrep="${ivy.basedir}/path/to/myrep" 
+					mysecondrep="${ivy.basedir}/path/to/secondrep" 
 					myseconddirlayout="[module]/[type]s"/>
 	</resolvers>
 </ivysettings>

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-macro+ref.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-macro%2Bref.xml?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-macro+ref.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-macro+ref.xml Tue Sep  2 05:07:20 2008
@@ -20,8 +20,8 @@
     <macrodef name="myresolver">
         <attribute name="name"/>
         <filesystem name="@{name}" m2compatible="true" checkconsistency="true" checkmodified="true" allownomd="false">
-            <artifact pattern="${some.dir}/[organisation]/[module]/[revision]/[type]s/[artifact]-[revision].[ext]" />
-            <ivy pattern="${some.dir}/[organisation]/[module]/[revision]/ivy.xml"/>
+            <artifact pattern="${ivy.basedir}/[organisation]/[module]/[revision]/[type]s/[artifact]-[revision].[ext]" />
+            <ivy pattern="${ivy.basedir}/[organisation]/[module]/[revision]/ivy.xml"/>
         </filesystem>
     </macrodef>
 

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-macro.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-macro.xml?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-macro.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-macro.xml Tue Sep  2 05:07:20 2008
@@ -24,12 +24,12 @@
 		<attribute name="myseconddirlayout" default="[organisation]/[module]/[type]s"/>
 		<chain>
 			<filesystem name="fs1">
-				<ivy pattern="@{mymainrep}/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
-				<artifact pattern="@{mymainrep}/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
+				<ivy pattern="${ivy.basedir}/@{mymainrep}/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
+				<artifact pattern="${ivy.basedir}/@{mymainrep}/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
 			</filesystem>
 			<filesystem name="fs2" latest="latest-time">
-				<ivy pattern="@{mysecondrep}/@{myseconddirlayout}/ivy-[revision].xml"/>
-				<artifact pattern="@{mysecondrep}/@{myseconddirlayout}/[artifact]-[revision].[ext]"/>
+				<ivy pattern="${ivy.basedir}/@{mysecondrep}/@{myseconddirlayout}/ivy-[revision].xml"/>
+				<artifact pattern="${ivy.basedir}/@{mysecondrep}/@{myseconddirlayout}/[artifact]-[revision].[ext]"/>
 			</filesystem>
 		</chain>
 	</macrodef>

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-packager.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-packager.xml?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-packager.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-packager.xml Tue Sep  2 05:07:20 2008
@@ -19,8 +19,8 @@
 <ivysettings>
 	<resolvers>
 		<packager name="packager"
-		         buildRoot="packager/build"
-		         resourceCache="packager/cache"
+		         buildRoot="${ivy.basedir}/packager/build"
+		         resourceCache="${ivy.basedir}/packager/cache"
 		         resourceURL="ftp://mirror.example.com/pub/resources/[organisation]/[module]/">
 		    <ivy pattern="http://ivyroundup.googlecode.com/svn/trunk/repo/modules/[organisation]/[module]/[revision]/ivy.xml"/>
 		    <artifact pattern="http://ivyroundup.googlecode.com/svn/trunk/repo/modules/[organisation]/[module]/[revision]/packager.xml"/>

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-ref.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-ref.xml?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-ref.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-ref.xml Tue Sep  2 05:07:20 2008
@@ -18,11 +18,11 @@
 -->
 <ivysettings>
 	<properties file="ivysettings.properties"/>
-	<settings   defaultCache="mycache"/>
+	<settings   defaultCache="${ivy.basedir}/mycache"/>
 	<resolvers>
 		<filesystem name="fs" latest="latest-time">
-			<ivy pattern="sharedrep/[organisation]/[module]/ivys/ivy-[revision].xml"/>
-			<artifact pattern="sharedrep/[organisation]/[module]/[type]s/[artifact]-[revision].[type]"/>
+			<ivy pattern="${ivy.basedir}/sharedrep/[organisation]/[module]/ivys/ivy-[revision].xml"/>
+			<artifact pattern="${ivy.basedir}/sharedrep/[organisation]/[module]/[type]s/[artifact]-[revision].[type]"/>
 		</filesystem>
 		<chain name="internal">
 			<filesystem ref="fs"/>

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-test.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-test.xml?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-test.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-test.xml Tue Sep  2 05:07:20 2008
@@ -17,10 +17,10 @@
    under the License.    
 -->
 <ivysettings>
-	<property name="shared" value="sharedrep"/>
-	<properties file="ivysettings.properties"/>
+	<property name="shared" value="${ivy.basedir}/sharedrep"/>
+	<properties file="ivysettings.properties" override="false" />
 	<settings defaultResolver="libraries" validate="false" />
-	<caches defaultCacheDir="mycache" checkUpToDate="false"
+	<caches defaultCacheDir="${ivy.basedir}/mycache" checkUpToDate="false"
 			ivyPattern="[module]/ivys/ivy-[revision].xml" 
 			artifactPattern="[module]/[type]s/[artifact]-[revision].[ext]" />
 	<latest-strategies>

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings.properties
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings.properties?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings.properties (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings.properties Tue Sep  2 05:07:20 2008
@@ -16,4 +16,5 @@
 #	 * specific language governing permissions and limitations
 #	 * under the License.
 #	 ***************************************************************
-libraries.dir=lib
+libraries.dir=${ivy.basedir}/lib
+shared=${ivy.basedir}/shared

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest-compatible.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest-compatible.xml?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest-compatible.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest-compatible.xml Tue Sep  2 05:07:20 2008
@@ -18,13 +18,13 @@
 -->
 <ivysettings>
 
-    <settings defaultCache="build/cache" defaultResolver="test" defaultConflictManager="latest-compatible" />
+    <settings defaultCache="${ivy.basedir}/build/cache" defaultResolver="test" defaultConflictManager="latest-compatible" />
 
     <resolvers>
         <filesystem name="test">
-            <ivy pattern="test/repositories/latest-compatible/[module]/[revision]/[artifact].[ext]"/>
+            <ivy pattern="${ivy.basedir}/test/repositories/latest-compatible/[module]/[revision]/[artifact].[ext]"/>
             <artifact
-                    pattern="test/repositories/latest-compatible/[module]/[revision]/[artifact].[ext]"/>
+                    pattern="${ivy.basedir}/test/repositories/latest-compatible/[module]/[revision]/[artifact].[ext]"/>
         </filesystem>
     </resolvers>
 </ivysettings>

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest-time-transitivity.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest-time-transitivity.xml?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest-time-transitivity.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest-time-transitivity.xml Tue Sep  2 05:07:20 2008
@@ -18,12 +18,12 @@
 -->
 <ivysettings>
 
-    <settings defaultCache="build/cache" defaultResolver="test" defaultConflictManager="latest-time" />
+    <settings defaultCache="${ivy.basedir}/build/cache" defaultResolver="test" defaultConflictManager="latest-time" />
 
     <resolvers>
        <filesystem name="test" latest="latest-time" checkmodified="true">
-        <artifact pattern="test/repositories/IVY-407/[organisation]/[module]/[type]/[artifact]-[revision].[ext]" />
-        <ivy pattern="test/repositories/IVY-407/[organisation]/[module]/ivy-[revision].xml" />
+        <artifact pattern="${ivy.basedir}/test/repositories/IVY-407/[organisation]/[module]/[type]/[artifact]-[revision].[ext]" />
+        <ivy pattern="${ivy.basedir}/test/repositories/IVY-407/[organisation]/[module]/ivy-[revision].xml" />
       </filesystem>
    </resolvers>
 

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest-time.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest-time.xml?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest-time.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest-time.xml Tue Sep  2 05:07:20 2008
@@ -18,13 +18,13 @@
 -->
 <ivysettings>
 
-    <settings defaultCache="build/cache" defaultResolver="test" defaultConflictManager="latest-time" />
+    <settings defaultCache="${ivy.basedir}/build/cache" defaultResolver="test" defaultConflictManager="latest-time" />
 
     <resolvers>
         <filesystem name="test">
             <artifact
-                    pattern="test/repositories/1/[organisation]/[module]/[type]s/[artifact]-[revision].[type]"/>
-            <ivy pattern="test/repositories/1/[organisation]/[module]/ivys/ivy-[revision].xml"/>
+                    pattern="${ivy.basedir}/test/repositories/1/[organisation]/[module]/[type]s/[artifact]-[revision].[type]"/>
+            <ivy pattern="${ivy.basedir}/test/repositories/1/[organisation]/[module]/ivys/ivy-[revision].xml"/>
         </filesystem>
     </resolvers>
 </ivysettings>

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest.xml?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-latest.xml Tue Sep  2 05:07:20 2008
@@ -18,13 +18,13 @@
 -->
 <ivysettings>
 
-    <settings defaultCache="build/cache" defaultResolver="test"/>
+    <settings defaultCache="${ivy.basedir}/build/cache" defaultResolver="test"/>
 
     <resolvers>
         <filesystem name="test">
             <artifact
-                    pattern="test/repositories/1/[organisation]/[module]/[type]s/[artifact]-[revision].[type]"/>
-            <ivy pattern="test/repositories/1/[organisation]/[module]/ivys/ivy-[revision].xml"/>
+                    pattern="${ivy.basedir}/test/repositories/1/[organisation]/[module]/[type]s/[artifact]-[revision].[type]"/>
+            <ivy pattern="${ivy.basedir}/test/repositories/1/[organisation]/[module]/ivys/ivy-[revision].xml"/>
         </filesystem>
     </resolvers>
 </ivysettings>

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-regexp-test.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-regexp-test.xml?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-regexp-test.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-regexp-test.xml Tue Sep  2 05:07:20 2008
@@ -18,7 +18,7 @@
 -->
 <ivysettings>
 
-    <settings defaultCache="build/cache"
+    <settings defaultCache="${ivy.basedir}/build/cache"
           defaultResolver="test"
           defaultConflictManager="regexp"
             />
@@ -26,8 +26,8 @@
     <resolvers>
         <filesystem name="test">
             <artifact
-                    pattern="test/repositories/1/[organisation]/[module]/[type]s/[artifact]-[revision].[type]"/>
-            <ivy pattern="test/repositories/1/[organisation]/[module]/ivys/ivy-[revision].xml"/>
+                    pattern="${ivy.basedir}/test/repositories/1/[organisation]/[module]/[type]s/[artifact]-[revision].[type]"/>
+            <ivy pattern="${ivy.basedir}/test/repositories/1/[organisation]/[module]/ivys/ivy-[revision].xml"/>
         </filesystem>
     </resolvers>
 

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-strict-test.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-strict-test.xml?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-strict-test.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/conflict/ivysettings-strict-test.xml Tue Sep  2 05:07:20 2008
@@ -18,15 +18,15 @@
 -->
 <ivysettings>
 
-  <settings defaultCache="build/cache"
+  <settings defaultCache="${ivy.basedir}/build/cache"
         defaultResolver="test"
         defaultConflictManager="strict"
   />
   
   <resolvers>
   	 <filesystem name="test" >
-  	 	<artifact pattern="test/repositories/1/[organisation]/[module]/[type]s/[artifact]-[revision].[type]" /> 
-	    <ivy pattern="test/repositories/1/[organisation]/[module]/ivys/ivy-[revision].xml" />
+  	 	<artifact pattern="${ivy.basedir}/test/repositories/1/[organisation]/[module]/[type]s/[artifact]-[revision].[type]" /> 
+	    <ivy pattern="${ivy.basedir}/test/repositories/1/[organisation]/[module]/ivys/ivy-[revision].xml" />
 	 </filesystem>
   </resolvers>
   

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/lock/ArtifactLockStrategyTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/lock/ArtifactLockStrategyTest.java?rev=691210&r1=691209&r2=691210&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/lock/ArtifactLockStrategyTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/lock/ArtifactLockStrategyTest.java Tue Sep  2 05:07:20 2008
@@ -104,9 +104,9 @@
         resolver.setName("test");
         resolver.setSettings(settings);
         resolver.addIvyPattern(
-            "test/repositories/1/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]");
+            settings.getBaseDir() + "/test/repositories/1/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]");
         resolver.addArtifactPattern(
-            "test/repositories/1/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]");
+            settings.getBaseDir() + "/test/repositories/1/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]");
         return resolver;
     }
 



Mime
View raw message