ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xav...@apache.org
Subject svn commit: r632723 - in /ant/ivy/core/trunk: ./ doc/configuration/ doc/ivyfile/ doc/use/ src/java/org/apache/ivy/ant/ src/java/org/apache/ivy/core/cache/ src/java/org/apache/ivy/core/check/ src/java/org/apache/ivy/core/event/resolve/ src/java/org/apac...
Date Sun, 02 Mar 2008 08:50:43 GMT
Author: xavier
Date: Sun Mar  2 00:50:33 2008
New Revision: 632723

URL: http://svn.apache.org/viewvc?rev=632723&view=rev
Log:
- NEW: Retain original dependency constraint rules in resolved ivy file (IVY-739)
- NEW: Add a new resolve mode (optionally per module) to utilize dynamic constraint rule metadata (IVY-740)

Added:
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-resolveMode.xml   (with props)
Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/doc/configuration/module.html
    ant/ivy/core/trunk/doc/configuration/triggers.html
    ant/ivy/core/trunk/doc/ivyfile/dependency.html
    ant/ivy/core/trunk/doc/use/resolve.html
    ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/RepositoryCacheManager.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngine.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/EndResolveDependencyEvent.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/StartResolveDependencyEvent.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DependencyDescriptor.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveData.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveOptions.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/core/sort/MessageBasedNonMatchingVersionReporter.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/sort/ModuleInSort.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/conflict/LatestCompatibleConflictManager.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.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/parser/xml/XmlModuleDescriptorWriter.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/ivy.xsd
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportWriter.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResourceResolver.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/CacheResolver.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/ChainResolver.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/DualResolver.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/ResolverSettings.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyDeliverTest.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-update-withvar.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-update.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test.xml
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/updated.xml
    ant/ivy/core/trunk/test/repositories/1/org1/mod1.1/ivys/ivy-1.0.1.xml

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Sun Mar  2 00:50:33 2008
@@ -64,6 +64,9 @@
 
    trunk version
 =====================================
+- NEW: Retain original dependency constraint rules in resolved ivy file (IVY-739)
+- NEW: Add a new resolve mode (optionally per module) to utilize dynamic constraint rule metadata (IVY-740)
+
 - IMPROVEMENT: Make Ivy standalone runnable with no required dependencies (IVY-757)
 - IMPROVEMENT: add branch attribute in ivy:install task (IVY-727)
 

Modified: ant/ivy/core/trunk/doc/configuration/module.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/configuration/module.html?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/doc/configuration/module.html (original)
+++ ant/ivy/core/trunk/doc/configuration/module.html Sun Mar  2 00:50:33 2008
@@ -38,6 +38,7 @@
 <li>the <a href="../configuration/resolvers.html">resolver</a> to use</li>
 <li>the <a href="../configuration/conflict-managers.html">conflict manager</a> to use</li>
 <li>the default <a href="../terminology.html#branch">branch</a> to use</li>
+<li>the [[ant:resolve resolve mode]] to use</li>
 </ul>
 
 <h1>Attributes</h1>
@@ -61,6 +62,8 @@
     <tr><td>conflict-manager</td><td>the name of the conflict manager to apply. <span class="since">since 1.4</span></td>
         <td>No</td></tr>
     <tr><td>branch</td><td>the default branch to apply. <span class="since">since 1.4</span></td>
+        <td>No</td></tr>
+    <tr><td>resolveMode</td><td>the resolve mode to use. <span class="since">since 2.0</span></td>
         <td>No</td></tr>
 </tbody>
 </table>

Modified: ant/ivy/core/trunk/doc/configuration/triggers.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/configuration/triggers.html?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/doc/configuration/triggers.html (original)
+++ ant/ivy/core/trunk/doc/configuration/triggers.html Sun Mar  2 00:50:33 2008
@@ -58,6 +58,8 @@
             <li>organisation</li>the organisation of the dependency resolved
             <li>module</li>the name of the dependency resolved
             <li>req-revision</li>the requested revision for the dependency <span class="since">since 2.0</span> (provided for consistency with post-resolve-dependency)
+            <li>req-revision-default</li>the default requested revision constraint for the dependency <span class="since">since 2.0</span>
+            <li>req-revision-dynamic</li>the requested revision dynamic constraint for the dependency <span class="since">since 2.0</span>
             <li>revision</li>the requested revision for the dependency
             <li>resolver</li>the name of the resolver used to resolve the dependency
           </ul>
@@ -70,6 +72,8 @@
             <li>organisation</li>the organisation of the dependency resolved
             <li>module</li>the name of the dependency resolved
             <li>req-revision</li>the requested revision for the dependency <span class="since">since 2.0</span>
+            <li>req-revision-default</li>the default requested revision constraint for the dependency <span class="since">since 2.0</span>
+            <li>req-revision-dynamic</li>the requested revision dynamic constraint for the dependency <span class="since">since 2.0</span>
             <li>revision</li>the revision of the dependency resolved, or the requested revision if the resolution was not successful
             <li>resolved</li>true if the resolution was successful, false otherwise
             <li>duration</li>the time elapsed to resolve the dependency (in ms) <span class="since">since 2.0</span>

Modified: ant/ivy/core/trunk/doc/ivyfile/dependency.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/ivyfile/dependency.html?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/doc/ivyfile/dependency.html (original)
+++ ant/ivy/core/trunk/doc/ivyfile/dependency.html Sun Mar  2 00:50:33 2008
@@ -52,6 +52,11 @@
 <span class="since">since 1.4</span> If you don't find a way to expression your dependency version constraint among these, you can <a href="../configuration/version-matchers.html">plug your own</a>.
 The way to determine which revision is the "latest" between two is configurable through the use of pluggable LatestStrategy. See <a href="../reference.html">ivy main concepts</a> for details about this.
 
+<h2><a name="revision-constraint">Revision constraint</a></h2>
+<span class="since">since 2.0</span> The dependency tag supports two revision attributes: rev, corresponding to the default required dependency revision, and revConstraint, corresponding to a dynamic revision constraint applied on this dependency. 
+
+Depending on the [[ant:resolve resolve mode]] used, the actual revision used during dependency resolution may vary. These revisions usually differ only for modules published in a repository. When [[ant:deliver]] is used, dynamic version constraints are replaced by a stic version constraint, to help build reproducibility. However, the information of the original version constraint is not lost, but rather put in the revConstraint attribute. This both ensure better metadata in the repository while still allowing easier build reproducibility. 
+
 <h2>Configurations mapping</h2>
 This mapping indicates which configurations of the dependency are required in which configurations of the current module, also called master configurations.
 
@@ -136,6 +141,8 @@
         <td>No, defaults to the default branch <a href="../configuration/conf.html">configured</a> for the dependency.</td></tr>
     <tr><td>rev</td><td>the revision of the dependency. See <a href="#revision">above</a> for details.</td>
         <td>Yes</td></tr>
+    <tr><td>revConstraint</td><td>the dynamic revision constraint originally used for this dependency. See <a href="#revision-constraint">above</a> for details.</td>
+        <td>No, defaults to the value of rev</td></tr>
     <tr><td>force</td><td>a boolean to give an indication to conflict manager that this dependency 
      should be forced to this revision (see <a href="../ivyfile/conflicts.html">conflicts manager</a>)</td>
         <td>No, defaults to false</td></tr>

Modified: ant/ivy/core/trunk/doc/use/resolve.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/use/resolve.html?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/doc/use/resolve.html (original)
+++ ant/ivy/core/trunk/doc/use/resolve.html Sun Mar  2 00:50:33 2008
@@ -83,7 +83,17 @@
 </ul>
 </ul>
 
-<span class="since">since 1.4</span> A new inline mode allow to call a resolve without an ivy file, by setting directly the module which should be resolved from the repository. It is particularly useful to install released software, like an ant task for example. When inline is set to true, the organisation module and revision attributes are used to specify which module should be resolved from the repository.
+<h2>Inline mode</h2>
+<span class="since">since 1.4</span> The inline mode allow to call a resolve without an ivy file, by setting directly the module which should be resolved from the repository. It is particularly useful to install released software, like an ant task for example. When inline is set to true, the organisation module and revision attributes are used to specify which module should be resolved from the repository.
+
+<h2>Resolve mode</h2>
+<span class="since">since 2.0</span> The resolve mode allows to define how Ivy should use dependency revision constraints when performing the resolution.
+
+Two modes are available:
+<ul>
+<li>default</li> In this mode the default revision constraint (expressed with the rev attribute in the [[ivyfile/dependency]] element) is used.
+<li>dynamic</li> In this mode the dynamic revision constraint (expressed with the revConstraint attribute in the [[ivyfile/dependency]] element) is used.
+</ul>
 
 <i>Note for developers:
 After the call to this task, a reference to the module descriptor resolved is put in the ant project under the id <code>"ivy.resolved.descriptor"</code>.</i>
@@ -101,6 +111,8 @@
 <span class="since">Since 2.0</span>, you can also use '*(private)', '*(public)'.  Note that when inline is true, the configuration '*' is equivalent as '*(public)'.</td><td>No. Defaults to ${ivy.configurations}</td></tr>
 
     <tr><td>refresh</td><td>true to force Ivy to resolve dynamic revision in this resolve process, false to use cached resolved revision <span class="since">since 2.0</span></td><td>No. defaults to false</td></tr>
+
+    <tr><td>resolveMode</td><td>the resolve mode to use for this dependency resolution process <span class="since">since 2.0</span></td><td>No. defaults to using the resolve mode set in the [[configuration settings]]</td></tr>
 
     <tr><td>inline</td><td>true to use inline mode, false to resolve an ivy file <span class="since">since 1.4</span></td><td>No. defaults to false</td></tr>
 

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java Sun Mar  2 00:50:33 2008
@@ -71,6 +71,8 @@
     private String failureProperty = null;
 
     private boolean useOrigin = false;
+    
+    private String resolveMode = null;
 
     private String resolveId = null;
     
@@ -335,6 +337,7 @@
                 .setUseCacheOnly(useCacheOnly)
                 .setRefresh(refresh)
                 .setTransitive(transitive)
+                .setResolveMode(resolveMode)
                 .setResolveId(resolveId);
     }
 
@@ -392,5 +395,13 @@
 
     public void setResolveId(String resolveId) {
         this.resolveId = resolveId;
+    }
+
+    public String getResolveMode() {
+        return resolveMode;
+    }
+
+    public void setResolveMode(String resolveMode) {
+        this.resolveMode = resolveMode;
     }
 }

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=632723&r1=632722&r2=632723&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 Sun Mar  2 00:50:33 2008
@@ -502,13 +502,14 @@
     }
 
     public ResolvedModuleRevision findModuleInCache(
-            DependencyDescriptor dd, CacheMetadataOptions options, String expectedResolver) {
-        ModuleRevisionId mrid = dd.getDependencyRevisionId();
-        if (isCheckmodified(dd, options)) {
+            DependencyDescriptor dd, ModuleRevisionId requestedRevisionId, 
+            CacheMetadataOptions options, String expectedResolver) {
+        ModuleRevisionId mrid = requestedRevisionId;
+        if (isCheckmodified(dd, requestedRevisionId, options)) {
             Message.verbose("don't use cache for " + mrid + ": checkModified=true");
             return null;
         }
-        if (isChanging(dd, options)) {
+        if (isChanging(dd, requestedRevisionId, options)) {
             Message.verbose("don't use cache for " + mrid + ": changing=true");
             return null;
         }
@@ -838,7 +839,7 @@
                         + " (resolved by " + rmr.getResolver().getName()
                         + "): but it's a default one, maybe we can find a better one");
                 } else {
-                    if (!isCheckmodified(dd, options) && !isChanging(dd, options)) {
+                    if (!isCheckmodified(dd, mrid, options) && !isChanging(dd, mrid, options)) {
                         Message.verbose("\t" + getName() + ": revision in cache: " + mrid);
                         rmr.getReport().setSearched(true);
                         return rmr;
@@ -853,7 +854,7 @@
                     } else {
                         Message.verbose("\t" + getName() + ": revision in cache is not up to date: "
                             + mrid);
-                        if (isChanging(dd, options)) {
+                        if (isChanging(dd, mrid, options)) {
                             // ivy file has been updated, we should see if it has a new publication
                             // date to see if a new download is required (in case the dependency is
                             // a changing one)
@@ -930,7 +931,7 @@
                             removeSavedArtifactOrigin(transformedArtifact);
                         }
                     }
-                } else if (isChanging(dd, options)) {
+                } else if (isChanging(dd, mrid, options)) {
                     Message.verbose(mrid
                         + " is changing, but has not changed: will trust cached artifacts if any");
                 }
@@ -1011,9 +1012,11 @@
     }
     
 
-    private boolean isChanging(DependencyDescriptor dd, CacheMetadataOptions options) {
+    private boolean isChanging(
+            DependencyDescriptor dd, ModuleRevisionId requestedRevisionId, 
+            CacheMetadataOptions options) {
         return dd.isChanging() 
-            || getChangingMatcher(options).matches(dd.getDependencyRevisionId().getRevision());
+            || getChangingMatcher(options).matches(requestedRevisionId.getRevision());
     }
 
     private Matcher getChangingMatcher(CacheMetadataOptions options) {
@@ -1032,7 +1035,9 @@
         return matcher.getMatcher(changingPattern);
     }
 
-    private boolean isCheckmodified(DependencyDescriptor dd, CacheMetadataOptions options) {
+    private boolean isCheckmodified(
+            DependencyDescriptor dd, ModuleRevisionId requestedRevisionId, 
+            CacheMetadataOptions options) {
         if (options.isCheckmodified() != null) {
             return options.isCheckmodified().booleanValue();
         }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/RepositoryCacheManager.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/RepositoryCacheManager.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/RepositoryCacheManager.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/RepositoryCacheManager.java Sun Mar  2 00:50:33 2008
@@ -22,6 +22,7 @@
 import org.apache.ivy.core.module.descriptor.Artifact;
 import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
+import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.core.report.ArtifactDownloadReport;
 import org.apache.ivy.core.resolve.ResolvedModuleRevision;
 import org.apache.ivy.plugins.repository.ArtifactResourceResolver;
@@ -67,6 +68,8 @@
      * 
      * @param dd
      *            the dependency descriptor identifying the module to search
+     * @param requestedRevisionId
+     *            the requested dependency module revision id identifying the module to search
      * @param options
      *            options on how caching should be handled
      * @param expectedResolver
@@ -76,7 +79,8 @@
      *         has been found in cache
      */
     public abstract ResolvedModuleRevision findModuleInCache(
-            DependencyDescriptor dd, CacheMetadataOptions options, String expectedResolver);
+            DependencyDescriptor dd, ModuleRevisionId requestedRevisionId, 
+            CacheMetadataOptions options, String expectedResolver);
     
     /**
      * Downloads an artifact to this cache.

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngine.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngine.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngine.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngine.java Sun Mar  2 00:50:33 2008
@@ -87,7 +87,7 @@
                     if (!"*".equals(masterConfs[j].trim())
                             && md.getConfiguration(masterConfs[j]) == null) {
                         Message.info("dependency required in non existing conf for " + ivyFile
-                                + " \n\tin " + dds[i].getDependencyRevisionId() + ": "
+                                + " \n\tin " + dds[i] + ": "
                                 + masterConfs[j]);
                         result = false;
                     }
@@ -106,7 +106,7 @@
                         if (!Arrays.asList(rmr.getDescriptor().getConfigurationsNames()).contains(
                             depConfs[j])) {
                             Message.info("dependency configuration is missing for " + ivyFile
-                                    + "\n\tin " + dds[i].getDependencyRevisionId() + ": "
+                                    + "\n\tin " + dds[i] + ": "
                                     + depConfs[j]);
                             result = false;
                         }
@@ -114,7 +114,7 @@
                         for (int k = 0; k < arts.length; k++) {
                             if (!resolver.exists(arts[k])) {
                                 Message.info("dependency artifact is missing for " + ivyFile
-                                        + "\n\t in " + dds[i].getDependencyRevisionId() + ": "
+                                        + "\n\t in " + dds[i] + ": "
                                         + arts[k]);
                                 result = false;
                             }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/EndResolveDependencyEvent.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/EndResolveDependencyEvent.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/EndResolveDependencyEvent.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/EndResolveDependencyEvent.java Sun Mar  2 00:50:33 2008
@@ -18,6 +18,7 @@
 package org.apache.ivy.core.event.resolve;
 
 import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
+import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.core.resolve.ResolvedModuleRevision;
 import org.apache.ivy.plugins.resolver.DependencyResolver;
 
@@ -28,9 +29,9 @@
 
     private long duration;
 
-    public EndResolveDependencyEvent(DependencyResolver resolver, DependencyDescriptor dd,
-            ResolvedModuleRevision module, long duration) {
-        super(NAME, resolver, dd);
+    public EndResolveDependencyEvent(DependencyResolver resolver, DependencyDescriptor dd, 
+            ModuleRevisionId requestedRevisionId, ResolvedModuleRevision module, long duration) {
+        super(NAME, resolver, dd, requestedRevisionId);
         this.module = module;
         this.duration = duration;
         addAttribute("duration", String.valueOf(duration));

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java Sun Mar  2 00:50:33 2008
@@ -19,6 +19,8 @@
 
 import org.apache.ivy.core.event.IvyEvent;
 import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
+import org.apache.ivy.core.module.id.ModuleRevisionId;
+import org.apache.ivy.core.resolve.ResolveData;
 import org.apache.ivy.plugins.resolver.DependencyResolver;
 
 public class ResolveDependencyEvent extends IvyEvent {
@@ -27,14 +29,18 @@
     private DependencyDescriptor dd;
 
     protected ResolveDependencyEvent(String name, DependencyResolver resolver,
-            DependencyDescriptor dd) {
+            DependencyDescriptor dd, ModuleRevisionId requestedRevisionId) {
         super(name);
         this.resolver = resolver;
         this.dd = dd;
         addAttribute("resolver", this.resolver.getName());
         addMridAttributes(this.dd.getDependencyRevisionId());
         addAttributes(this.dd.getExtraAttributes());
-        addAttribute("req-revision", dd.getDependencyRevisionId().getRevision());
+        addAttribute("req-revision", requestedRevisionId.getRevision());
+        addAttribute("req-revision-default", 
+            dd.getDependencyRevisionId().getRevision());
+        addAttribute("req-revision-dynamic", 
+            dd.getDynamicConstraintDependencyRevisionId().getRevision());
     }
 
     public DependencyDescriptor getDependencyDescriptor() {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/StartResolveDependencyEvent.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/StartResolveDependencyEvent.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/StartResolveDependencyEvent.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/StartResolveDependencyEvent.java Sun Mar  2 00:50:33 2008
@@ -18,13 +18,16 @@
 package org.apache.ivy.core.event.resolve;
 
 import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
+import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.plugins.resolver.DependencyResolver;
 
 public class StartResolveDependencyEvent extends ResolveDependencyEvent {
     public static final String NAME = "pre-resolve-dependency";
 
-    public StartResolveDependencyEvent(DependencyResolver resolver, DependencyDescriptor dd) {
-        super(NAME, resolver, dd);
+    public StartResolveDependencyEvent(
+            DependencyResolver resolver, DependencyDescriptor dd, 
+            ModuleRevisionId requestedRevisionId) {
+        super(NAME, resolver, dd, requestedRevisionId);
     }
 
 }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java Sun Mar  2 00:50:33 2008
@@ -81,8 +81,11 @@
             NamespaceTransformer t, boolean fromSystem) {
         ModuleRevisionId transformParentId = t.transform(dd.getParentRevisionId());
         ModuleRevisionId transformMrid = t.transform(dd.getDependencyRevisionId());
-        DefaultDependencyDescriptor newdd = new DefaultDependencyDescriptor(null, transformMrid, dd
-                .isForce(), dd.isChanging(), dd.isTransitive());
+        ModuleRevisionId transformDynamicMrid = 
+            t.transform(dd.getDynamicConstraintDependencyRevisionId());
+        DefaultDependencyDescriptor newdd = new DefaultDependencyDescriptor(
+            null, transformMrid, transformDynamicMrid, 
+            dd.isForce(), dd.isChanging(), dd.isTransitive());
         newdd.parentId = transformParentId;
         String[] moduleConfs = dd.getModuleConfigurations();
         if (moduleConfs.length == 1 && "*".equals(moduleConfs[0])) {
@@ -117,6 +120,8 @@
 
     private ModuleRevisionId revId;
 
+    private ModuleRevisionId dynamicRevId;
+
     private Map confs = new LinkedHashMap();
 
     // Map (String masterConf -> Collection(DependencyArtifactDescriptor))
@@ -157,6 +162,7 @@
         md = null;
         parentId = dd.getParentRevisionId();
         revId = ModuleRevisionId.newInstance(dd.getDependencyRevisionId(), revision);
+        dynamicRevId = dd.getDynamicConstraintDependencyRevisionId();
         isForce = dd.isForce();
         isChanging = dd.isChanging();
         isTransitive = dd.isTransitive();
@@ -173,10 +179,18 @@
         }
     }
 
-    public DefaultDependencyDescriptor(ModuleDescriptor md, ModuleRevisionId mrid, boolean force,
+    public DefaultDependencyDescriptor(
+            ModuleDescriptor md, ModuleRevisionId mrid, boolean force,
             boolean changing, boolean transitive) {
+        this(md, mrid, mrid, force, changing, transitive);
+    }
+
+    public DefaultDependencyDescriptor(
+            ModuleDescriptor md, ModuleRevisionId mrid, ModuleRevisionId dynamicConstraint, 
+            boolean force, boolean changing, boolean transitive) {
         this.md = md;
         revId = mrid;
+        dynamicRevId = dynamicConstraint;
         isForce = force;
         isChanging = changing;
         isTransitive = transitive;
@@ -199,6 +213,10 @@
 
     public ModuleRevisionId getDependencyRevisionId() {
         return revId;
+    }
+    
+    public ModuleRevisionId getDynamicConstraintDependencyRevisionId() {
+        return dynamicRevId;
     }
 
     public String[] getModuleConfigurations() {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DependencyDescriptor.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DependencyDescriptor.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DependencyDescriptor.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DependencyDescriptor.java Sun Mar  2 00:50:33 2008
@@ -24,7 +24,21 @@
 import org.apache.ivy.util.extendable.ExtendableItem;
 
 /**
- *
+ * Describes a dependency from a depender to a dependee.
+ * <p>
+ * The main information this descriptor contains is the constraint on the dependency. There is
+ * actually two kind of dependency constraints: the default dependency constraint, which can be
+ * obtained with {@link #getDependencyRevisionId()}, and corresponds to the <code>rev</code>
+ * attribute in Ivy files. This is the constraint as it should be honored by Ivy in default resolve
+ * mode.
+ * </p><p> 
+ * Then there is the dynamic constraint, which can either be the same as the default
+ * constraint, or the original dependency constraint when an Ivy file is delivered an published to a
+ * repository. This dynamic constraint is returned by
+ * {@link #getDynamicConstraintDependencyRevisionId()}, and corresponds to the
+ * <code>revconstraint</code> attribute in the Ivy file. In some resolve mode, this constraint can
+ * be used instead of the default dependency constraint when performing dependency resolution.
+ * </p>
  */
 public interface DependencyDescriptor extends ExtendableItem {
     ModuleId getDependencyId();
@@ -51,7 +65,20 @@
 
     ModuleRevisionId getParentRevisionId();
 
+    /**
+     * Returns the constraint on dependency this descriptor represents.
+     * 
+     * @return the constraint on dependency.
+     */
     ModuleRevisionId getDependencyRevisionId();
+
+    /**
+     * Returns the dynamic constraint on dependency this descriptor represents.
+     * 
+     * @return the dynamic constraint on dependency, or exact constraint if no dynamic constraint is
+     *         specified.
+     */
+    ModuleRevisionId getDynamicConstraintDependencyRevisionId();
 
     String[] getModuleConfigurations();
 

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java Sun Mar  2 00:50:33 2008
@@ -167,7 +167,7 @@
     private Map blacklisted = new HashMap();
 
     public IvyNode(ResolveData data, IvyNode parent, DependencyDescriptor dd) {
-        id = dd.getDependencyRevisionId();
+        id = data.getEngine().getRequestedDependencyRevisionId(dd, data.getOptions());
         dds.put(parent, dd);
         root = parent.getRoot();
         init(data);
@@ -220,12 +220,15 @@
                     Message.debug("\tusing " + resolver + " to resolve " + getId());
                     DependencyDescriptor dependencyDescriptor = getDependencyDescriptor(parent);
                     long start = System.currentTimeMillis();
+                    ModuleRevisionId requestedRevisionId = 
+                        data.getRequestedDependencyRevisionId(dependencyDescriptor);
                     data.getEventManager().fireIvyEvent(
-                        new StartResolveDependencyEvent(resolver, dependencyDescriptor));
+                        new StartResolveDependencyEvent(resolver, dependencyDescriptor, requestedRevisionId));
                     module = resolver.getDependency(dependencyDescriptor, data);
                     data.getEventManager().fireIvyEvent(
-                        new EndResolveDependencyEvent(resolver, dependencyDescriptor, module,
-                            System.currentTimeMillis() - start));
+                        new EndResolveDependencyEvent(resolver, dependencyDescriptor, requestedRevisionId, 
+                            module, System.currentTimeMillis() - start));
+                    
                     if (module != null) {
                         module.getResolver().getRepositoryCacheManager().saveResolvers(
                             module.getDescriptor(),
@@ -374,13 +377,17 @@
                 // it is exactly the same as if there was no dependency at all on it
                 continue;
             }
-            if (isDependencyModuleExcluded(rootModuleConf, dd.getDependencyRevisionId(), conf)) {
+            ModuleRevisionId requestedDependencyRevisionId = 
+                data.getEngine().getRequestedDependencyRevisionId(dd, data.getOptions());
+            if (isDependencyModuleExcluded(rootModuleConf, requestedDependencyRevisionId, conf)) {
                 // the whole module is excluded, it is considered as not being part of dependencies
                 // at all
-                Message.verbose("excluding " + dd.getDependencyRevisionId() + " in " + conf);
+                Message.verbose("excluding " + dd + " in " + conf);
                 continue;
             }
-            IvyNode depNode = data.getNode(dd.getDependencyRevisionId());
+            IvyNode depNode = data.getNode(
+                requestedDependencyRevisionId);
+            
             if (depNode == null) {
                 depNode = new IvyNode(data, this, dd);
             } else {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java Sun Mar  2 00:50:33 2008
@@ -95,8 +95,8 @@
             return mrid.toString();
         }
 
-        public ModuleRevisionId getAskedDependencyId() {
-            return dd.getDependencyRevisionId();
+        public ModuleRevisionId getAskedDependencyId(ResolveData resolveData) {
+            return resolveData.getRequestedDependencyRevisionId(dd);
         }
 
         public ModuleDescriptor getModuleDescriptor() {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveData.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveData.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveData.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveData.java Sun Mar  2 00:50:33 2008
@@ -26,6 +26,7 @@
 import java.util.Map.Entry;
 
 import org.apache.ivy.core.event.EventManager;
+import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.core.report.ConfigurationResolveReport;
 
@@ -179,4 +180,7 @@
         return node != null && node.isBlacklisted(rootModuleConf);
     }
 
+    public ModuleRevisionId getRequestedDependencyRevisionId(DependencyDescriptor dd) {
+        return getEngine().getRequestedDependencyRevisionId(dd, getOptions());
+    }
 }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java Sun Mar  2 00:50:33 2008
@@ -254,7 +254,8 @@
                         if (dd != null) {
                             ModuleRevisionId depResolvedId = dependencies[i].getResolvedId();
                             ModuleDescriptor depDescriptor = dependencies[i].getDescriptor();
-                            ModuleRevisionId depRevisionId = dd.getDependencyRevisionId();
+                            ModuleRevisionId depRevisionId = 
+                                getRequestedDependencyRevisionId(dd, options);
                             if (depResolvedId == null) {
                                 throw new NullPointerException("getResolvedId() is null for " 
                                     + dependencies[i].toString());
@@ -962,6 +963,30 @@
             throw new RuntimeException("problem while parsing repository module descriptor for "
                     + id + ": " + e, e);
         }
+    }
+
+    /**
+     * Returns the module revision id constraint requested by the given dependency descriptor,
+     * according to the given resolve options.
+     * 
+     * @param dd
+     *            the dependency descriptor for which the requested module revision id should be
+     *            returned
+     * @param options
+     *            the resolve options to use
+     * @return the {@link ModuleRevisionId} corresponding to the requested dependency constraint
+     */
+    public ModuleRevisionId getRequestedDependencyRevisionId(
+            DependencyDescriptor dd, ResolveOptions options) {
+        if (dd == null) {
+            return null;
+        }
+        String resolveMode = options.getResolveMode() == null 
+            ? settings.getResolveMode(dd.getDependencyId())
+                    : options.getResolveMode();
+        return ResolveOptions.RESOLVEMODE_DYNAMIC.equals(resolveMode) 
+            ? dd.getDynamicConstraintDependencyRevisionId() 
+            : dd.getDependencyRevisionId();
     }
 
     public EventManager getEventManager() {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveOptions.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveOptions.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveOptions.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveOptions.java Sun Mar  2 00:50:33 2008
@@ -34,6 +34,20 @@
 public class ResolveOptions extends LogOptions {
     
     /**
+     * Default resolve mode, using default revision constraints in dependency descriptors.
+     */
+    public static final String RESOLVEMODE_DEFAULT = "default";
+    /**
+     * Dynamic resolve mode, using dynamic revision constraints in dependency descriptors.
+     */
+    public static final String RESOLVEMODE_DYNAMIC = "dynamic";
+    /**
+     * Array of all available resolve modes.
+     */
+    public static final String[] RESOLVEMODES = 
+        new String[] {RESOLVEMODE_DEFAULT, RESOLVEMODE_DYNAMIC};
+
+    /**
      * an array of configuration names to resolve - must not be null nor empty
      */
     private String[] confs = new String[] {"*"};
@@ -85,6 +99,12 @@
      * A filter to use to avoid downloading all artifacts.
      */
     private Filter artifactFilter = FilterHelper.NO_FILTER;
+    
+    /**
+     * The resolve mode to use. Should be one of {@link #RESOLVEMODES}, or <code>null</code> to
+     * use settings configured resolve mode.
+     */
+    private String resolveMode;
 
     /**
      * The id used to store the resolve information.
@@ -107,6 +127,7 @@
         transitive = options.transitive;
         download = options.download;
         outputReport = options.outputReport;
+        resolveMode = options.resolveMode;
         artifactFilter = options.artifactFilter;
         resolveId = options.resolveId;
     }
@@ -117,6 +138,21 @@
 
     public ResolveOptions setArtifactFilter(Filter artifactFilter) {
         this.artifactFilter = artifactFilter;
+        return this;
+    }
+    
+    /**
+     * Returns the resolve mode to use, or <code>null</code> to use settings configured resolve
+     * mode.
+     * 
+     * @return the resolve mode to use.
+     */
+    public String getResolveMode() {
+        return resolveMode;
+    }
+    
+    public ResolveOptions setResolveMode(String resolveMode) {
+        this.resolveMode = resolveMode;
         return this;
     }
 

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=632723&r1=632722&r2=632723&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 Sun Mar  2 00:50:33 2008
@@ -54,6 +54,7 @@
 import org.apache.ivy.core.publish.PublishEngineSettings;
 import org.apache.ivy.core.repository.RepositoryManagementEngineSettings;
 import org.apache.ivy.core.resolve.ResolveEngineSettings;
+import org.apache.ivy.core.resolve.ResolveOptions;
 import org.apache.ivy.core.retrieve.RetrieveEngineSettings;
 import org.apache.ivy.core.sort.SortEngineSettings;
 import org.apache.ivy.plugins.IvySettingsAware;
@@ -200,6 +201,8 @@
 
     private boolean defaultUseOrigin;
 
+    private String defaultResolveMode = ResolveOptions.RESOLVEMODE_DEFAULT;
+
     public IvySettings() {
         this(new IvyVariableContainerImpl());
     }
@@ -689,12 +692,12 @@
     /**
      * regular expressions as explained in Pattern class may be used in attributes
      */
-    public void addModuleConfiguration(Map attributes, PatternMatcher matcher, String resolverName,
-            String branch, String conflictManager) {
+    public void addModuleConfiguration(Map attributes, PatternMatcher matcher, 
+            String resolverName, String branch, String conflictManager, String resolveMode) {
         checkResolverName(resolverName);
         moduleSettings.defineRule(
             new MapMatcher(attributes, matcher), 
-            new ModuleSettings(resolverName, branch, conflictManager));
+            new ModuleSettings(resolverName, branch, conflictManager, resolveMode));
     }
 
     public File getDefaultIvyUserDir() {
@@ -834,6 +837,23 @@
         }
     }
 
+    public String getResolveMode(ModuleId moduleId) {
+        ModuleSettings ms = (ModuleSettings) moduleSettings.getRule(moduleId, new Filter() {
+            public boolean accept(Object o) {
+                return ((ModuleSettings) o).getResolveMode() != null;
+            }
+        });
+        return ms == null ? getDefaultResolveMode() : ms.getResolveMode();
+    }
+
+    public String getDefaultResolveMode() {
+        return defaultResolveMode;
+    }
+    
+    public void setDefaultResolveMode(String defaultResolveMode) {
+        this.defaultResolveMode = defaultResolveMode;
+    }
+
     public void addConfigured(ConflictManager cm) {
         addConflictManager(cm.getName(), cm);
     }
@@ -1220,15 +1240,21 @@
 
         private String conflictManager;
 
-        public ModuleSettings(String resolver, String branchName, String conflictMgr) {
-            resolverName = resolver;
-            branch = branchName;
-            conflictManager = conflictMgr;
+        private String resolveMode;
+
+        public ModuleSettings(
+                String resolver, String branchName, String conflictMgr, String resolveMode) {
+            this.resolverName = resolver;
+            this.branch = branchName;
+            this.conflictManager = conflictMgr;
+            this.resolveMode = resolveMode;
         }
 
         public String toString() {
-            return resolverName != null ? "resolver: " + resolverName
-                    : "" + branch != null ? "branch: " + branch : "";
+            return (resolverName != null ? "resolver: " + resolverName : "")
+                + (branch != null ? "branch: " + branch : "")
+                + (conflictManager != null ? "conflictManager: " + conflictManager : "")
+                + (resolveMode != null ? "resolveMode: " + resolveMode : "");
         }
 
         public String getBranch() {
@@ -1239,8 +1265,12 @@
             return resolverName;
         }
 
-        protected String getConflictManager() {
+        public String getConflictManager() {
             return conflictManager;
+        }
+
+        public String getResolveMode() {
+            return resolveMode;
         }
     }
 

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=632723&r1=632722&r2=632723&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 Sun Mar  2 00:50:33 2008
@@ -396,10 +396,11 @@
                 String resolver = (String) attributes.remove("resolver");
                 String branch = (String) attributes.remove("branch");
                 String cm = (String) attributes.remove("conflict-manager");
+                String resolveMode = (String) attributes.remove("resolveMode");
                 String matcher = (String) attributes.remove("matcher");
                 matcher = matcher == null ? PatternMatcher.EXACT_OR_REGEXP : matcher;
                 ivy.addModuleConfiguration(attributes, ivy
-                        .getMatcher(matcher), resolver, branch, cm);
+                        .getMatcher(matcher), resolver, branch, cm, resolveMode);
             }
         } catch (ParseException ex) {
             throw new SAXException("problem in config file: " + ex.getMessage(), ex);

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/sort/MessageBasedNonMatchingVersionReporter.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/sort/MessageBasedNonMatchingVersionReporter.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/sort/MessageBasedNonMatchingVersionReporter.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/sort/MessageBasedNonMatchingVersionReporter.java Sun Mar  2 00:50:33 2008
@@ -25,7 +25,8 @@
 abstract class MessageBasedNonMatchingVersionReporter implements NonMatchingVersionReporter {
 
     public void reportNonMatchingVersion(DependencyDescriptor descriptor, ModuleDescriptor md) {
-        ModuleRevisionId dependencyRevisionId = descriptor.getDependencyRevisionId();
+        ModuleRevisionId dependencyRevisionId = 
+            descriptor.getDynamicConstraintDependencyRevisionId();
         ModuleRevisionId parentRevisionId = descriptor.getParentRevisionId();
         if (parentRevisionId == null) {
             // There are some rare case where DependencyDescriptor have no parent.

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/sort/ModuleInSort.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/sort/ModuleInSort.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/sort/ModuleInSort.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/sort/ModuleInSort.java Sun Mar  2 00:50:33 2008
@@ -179,7 +179,7 @@
         ModuleDescriptor md = module;
         return md.getResolvedModuleRevisionId().getRevision() == null
                 || md.getResolvedModuleRevisionId().getRevision().equals(Ivy.getWorkingRevision())
-                || versionMatcher.accept(descriptor.getDependencyRevisionId(), md);
+                || versionMatcher.accept(descriptor.getDynamicConstraintDependencyRevisionId(), md);
         // Checking md.getResolvedModuleRevisionId().getRevision().equals(Ivy.getWorkingRevision()
         // allow to consider any local non resolved ivy.xml
         // as a valid module.

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/conflict/LatestCompatibleConflictManager.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/conflict/LatestCompatibleConflictManager.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/conflict/LatestCompatibleConflictManager.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/conflict/LatestCompatibleConflictManager.java Sun Mar  2 00:50:33 2008
@@ -244,7 +244,7 @@
             if (callerNode.isBlacklisted(rootModuleConf)) {
                 continue;
             }
-            if (versionMatcher.isDynamic(callers[i].getAskedDependencyId())) {
+            if (versionMatcher.isDynamic(callers[i].getAskedDependencyId(node.getData()))) {
                 blacklisted.add(new IvyNodeBlacklist(
                     conflictParent, selectedNode, evictedNode, node, rootModuleConf));
             } else {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java Sun Mar  2 00:50:33 2008
@@ -178,7 +178,7 @@
                         }
                     }
                 } else {
-                    addError("invalid conf " + conf[i] + " for " + dd.getDependencyRevisionId());
+                    addError("invalid conf " + conf[i] + " for " + dd);
                 }
             }
 
@@ -206,7 +206,7 @@
 
             int endConditionIndex = conf.indexOf(']');
             if (endConditionIndex == -1) {
-                addError("invalid conf " + conf + " for " + dd.getDependencyRevisionId());
+                addError("invalid conf " + conf + " for " + dd);
                 return null;
             }
 

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java Sun Mar  2 00:50:33 2008
@@ -70,7 +70,7 @@
  */
 public final class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
     static final String[] DEPENDENCY_REGULAR_ATTRIBUTES = new String[] {"org", "name", "branch",
-            "rev", "force", "transitive", "changing", "conf"};
+            "rev", "revConstraint", "force", "transitive", "changing", "conf"};
 
     private static final XmlModuleDescriptorParser INSTANCE = new XmlModuleDescriptorParser();
 
@@ -471,9 +471,15 @@
             String name = ivy.substitute(attributes.getValue("name"));
             String branch = ivy.substitute(attributes.getValue("branch"));
             String rev = ivy.substitute(attributes.getValue("rev"));
-            dd = new DefaultDependencyDescriptor(md, ModuleRevisionId.newInstance(org,
-                name, branch, rev, ExtendableItemHelper.getExtraAttributes(attributes,
-                    DEPENDENCY_REGULAR_ATTRIBUTES)), force, changing, transitive);
+            String revConstraint = ivy.substitute(attributes.getValue("revConstraint"));
+            revConstraint = revConstraint == null ? rev : revConstraint;
+            Map extraAttributes = ExtendableItemHelper.getExtraAttributes(
+                attributes, DEPENDENCY_REGULAR_ATTRIBUTES);
+            dd = new DefaultDependencyDescriptor(
+                md, 
+                ModuleRevisionId.newInstance(org, name, branch, rev, extraAttributes), 
+                ModuleRevisionId.newInstance(org, name, branch, revConstraint, extraAttributes), 
+                force, changing, transitive);
             md.addDependency(dd);
             String confs = ivy.substitute(attributes.getValue("conf"));
             if (confs != null && confs.length() > 0) {

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=632723&r1=632722&r2=632723&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 Sun Mar  2 00:50:33 2008
@@ -393,11 +393,17 @@
             }
             
             String revision = substitute(settings, attributes.getValue("rev"));
+            String revisionConstraint = substitute(settings, attributes.getValue("revConstraint"));
+            Map extraAttributes = ExtendableItemHelper.getExtraAttributes(attributes,
+                XmlModuleDescriptorParser.DEPENDENCY_REGULAR_ATTRIBUTES);
             ModuleRevisionId localMrid = ModuleRevisionId.newInstance(org, module, branch,
-                revision, ExtendableItemHelper.getExtraAttributes(attributes,
-                    XmlModuleDescriptorParser.DEPENDENCY_REGULAR_ATTRIBUTES));
+                revision, extraAttributes);
+            ModuleRevisionId localConstraintMrid = ModuleRevisionId.newInstance(org, module, branch,
+                revisionConstraint, extraAttributes);
             ModuleRevisionId systemMrid = ns == null ? localMrid : ns.getToSystemTransformer()
                     .transform(localMrid);
+            ModuleRevisionId systemConstraintMrid = ns == null ? localConstraintMrid 
+                    : ns.getToSystemTransformer().transform(localConstraintMrid);
 
             for (int i = 0; i < attributes.getLength(); i++) {
                 String attName = attributes.getQName(i);
@@ -405,9 +411,14 @@
                     String rev = (String) resolvedRevisions.get(systemMrid);
                     if (rev != null) {
                         write(" rev=\"" + rev + "\"");
+                        if (attributes.getIndex("revConstraint") == -1) {
+                            write(" revConstraint=\"" + systemMrid.getRevision() + "\"");
+                        }
                     } else {
                         write(" rev=\"" + systemMrid.getRevision() + "\"");
                     }
+                } else if ("revConstraint".equals(attName)) {
+                    write(" revConstraint=\"" + revisionConstraint + "\"");
                 } else if ("org".equals(attName)) {
                     write(" org=\"" + systemMrid.getOrganisation() + "\"");
                 } else if ("name".equals(attName)) {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java Sun Mar  2 00:50:33 2008
@@ -94,6 +94,11 @@
                     + XMLHelper.escape(dds[i].getDependencyRevisionId().getName()) + "\"");
                 out.print(" rev=\"" 
                     + XMLHelper.escape(dds[i].getDependencyRevisionId().getRevision()) + "\"");
+                if (!dds[i].getDynamicConstraintDependencyRevisionId()
+                        .equals(dds[i].getDependencyRevisionId())) {
+                    out.print(" revConstraint=\"" + XMLHelper.escape(
+                        dds[i].getDynamicConstraintDependencyRevisionId().getRevision()) + "\"");
+                }
                 if (dds[i].isForce()) {
                     out.print(" force=\"" + dds[i].isForce() + "\"");
                 }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/ivy.xsd
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/ivy.xsd?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/ivy.xsd (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/ivy.xsd Sun Mar  2 00:50:33 2008
@@ -202,6 +202,7 @@
 						            <xs:attribute name="name" type="xs:string" use="required"/>
 						            <xs:attribute name="branch" type="xs:string"/>
 						            <xs:attribute name="rev" type="xs:string" use="required"/>
+						            <xs:attribute name="revConstraint" type="xs:string"/>
 						            <xs:attribute name="force" type="xs:boolean"/>
 						            <xs:attribute name="changing" type="xs:boolean" default="false"/>
 						            <xs:attribute name="transitive" type="xs:boolean" default="true"/>

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportWriter.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportWriter.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportWriter.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportWriter.java Sun Mar  2 00:50:33 2008
@@ -233,7 +233,15 @@
                         toString(callers[i].getCallerConfigurations())) + "\""
                     + " rev=\"" 
                     + XMLHelper.escape(
-                        callers[i].getAskedDependencyId().getRevision()) + "\""
+                        callers[i].getAskedDependencyId(dep.getData()).getRevision()) + "\""
+                    + " rev-constraint-default=\"" 
+                    + XMLHelper.escape(
+                        callers[i].getDependencyDescriptor()
+                            .getDependencyRevisionId().getRevision()) + "\""
+                    + " rev-constraint-dynamic=\"" 
+                    + XMLHelper.escape(
+                        callers[i].getDependencyDescriptor()
+                            .getDynamicConstraintDependencyRevisionId().getRevision()) + "\""
                     + " callerrev=\"" 
                     + XMLHelper.escape(
                         callers[i].getModuleRevisionId().getRevision()) + "\""

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java Sun Mar  2 00:50:33 2008
@@ -287,14 +287,15 @@
     }
 
     protected ResolvedModuleRevision findModuleInCache(
-            DependencyDescriptor dd, CacheMetadataOptions options) {
-        return findModuleInCache(dd, options, false);
+            DependencyDescriptor dd, ResolveData data) {
+        return findModuleInCache(dd, data, false);
     }
 
     protected ResolvedModuleRevision findModuleInCache(
-            DependencyDescriptor dd, CacheMetadataOptions options, boolean anyResolver) {
+            DependencyDescriptor dd, ResolveData data, boolean anyResolver) {
         return getRepositoryCacheManager().findModuleInCache(
-            dd, options, anyResolver ? null : getName());
+            dd, data.getRequestedDependencyRevisionId(dd), 
+            getCacheOptions(data), anyResolver ? null : getName());
     }
 
     public void setChangingMatcher(String changingMatcherName) {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResourceResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResourceResolver.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResourceResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResourceResolver.java Sun Mar  2 00:50:33 2008
@@ -69,7 +69,7 @@
     }
 
     public ResolvedResource findIvyFileRef(DependencyDescriptor dd, ResolveData data) {
-        ModuleRevisionId mrid = dd.getDependencyRevisionId();
+        ModuleRevisionId mrid = data.getRequestedDependencyRevisionId(dd);
         if (isM2compatible()) {
             mrid = convertM2IdForResourceSearch(mrid);
         }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java Sun Mar  2 00:50:33 2008
@@ -138,8 +138,8 @@
         try {
             clearIvyAttempts();
             clearArtifactAttempts();
-            ModuleRevisionId systemMrid = systemDd.getDependencyRevisionId();
-            ModuleRevisionId  nsMrid = nsDd.getDependencyRevisionId();
+            ModuleRevisionId systemMrid = data.getRequestedDependencyRevisionId(systemDd);
+            ModuleRevisionId nsMrid = data.getRequestedDependencyRevisionId(nsDd);
             
             // check revision
             int index = systemMrid.getRevision().indexOf("@");
@@ -159,7 +159,7 @@
 
             // we first search for the dependency in cache
             ResolvedModuleRevision rmr = null;
-            rmr = findModuleInCache(systemDd, getCacheOptions(data));
+            rmr = findModuleInCache(systemDd, data);
             if (rmr != null) {
                 if (rmr.getDescriptor().isDefault() && rmr.getResolver() != this) {
                     Message.verbose("\t" + getName() + ": found revision in cache: " 
@@ -383,7 +383,7 @@
         DependencyDescriptor nsDd = dd;
         dd = toSystem(nsDd);
         
-        ModuleRevisionId mrid = dd.getDependencyRevisionId();
+        ModuleRevisionId mrid = data.getRequestedDependencyRevisionId(dd);
         ModuleDescriptorParser parser = ModuleDescriptorParserRegistry
                 .getInstance().getParser(mdRef.getResource());
         if (parser == null) {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/CacheResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/CacheResolver.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/CacheResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/CacheResolver.java Sun Mar  2 00:50:33 2008
@@ -56,11 +56,11 @@
             throws ParseException {
         clearIvyAttempts();
 
-        ModuleRevisionId mrid = dd.getDependencyRevisionId();
+        ModuleRevisionId mrid = data.getRequestedDependencyRevisionId(dd);
         // check revision
 
         ResolvedModuleRevision rmr = getRepositoryCacheManager()
-            .findModuleInCache(dd, getCacheOptions(data), null);
+            .findModuleInCache(dd, mrid, getCacheOptions(data), null);
         if (rmr != null) {
             Message.verbose("\t" + getName() + ": revision in cache: " + mrid);
             return rmr;
@@ -84,7 +84,8 @@
                     return node.getModuleRevision();
                 }
                 rmr = getRepositoryCacheManager().findModuleInCache(
-                        new DefaultDependencyDescriptor(dd, ivyRef.getRevision()), 
+                        new DefaultDependencyDescriptor(dd, ivyRef.getRevision()),
+                        dd.getDependencyRevisionId(),
                         getCacheOptions(data), null);
                 if (rmr != null) {
                     Message.verbose("\t" + getName() + ": revision in cache: " + resolvedMrid);

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/ChainResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/ChainResolver.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/ChainResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/ChainResolver.java Sun Mar  2 00:50:33 2008
@@ -106,11 +106,11 @@
 
         ResolvedModuleRevision mr = null;
 
-        ModuleRevisionId mrid = dd.getDependencyRevisionId();
+        ModuleRevisionId mrid = data.getRequestedDependencyRevisionId(dd);
 
 
         Message.verbose(getName() + ": Checking cache for: " + dd);
-        mr = findModuleInCache(dd, getCacheOptions(data), true);
+        mr = findModuleInCache(dd, data, true);
         if (mr != null) {
             Message.verbose(getName() + ": module revision found in cache: " + mr.getId());
             return resolvedRevision(mr);

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/DualResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/DualResolver.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/DualResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/DualResolver.java Sun Mar  2 00:50:33 2008
@@ -70,7 +70,7 @@
         if (mr == null) {
             checkInterrupted();
             if (isAllownomd()) {
-                Message.verbose("ivy resolver didn't find " + dd.getDependencyRevisionId()
+                Message.verbose("ivy resolver didn't find " + dd
                         + ": trying with artifact resolver");
                 return artifactResolver.getDependency(dd, data);
             } else {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java Sun Mar  2 00:50:33 2008
@@ -80,7 +80,7 @@
 
     public ResolvedResource findIvyFileRef(DependencyDescriptor dd, ResolveData data) {
         if (isM2compatible() && isUsepoms()) {
-            ModuleRevisionId mrid = dd.getDependencyRevisionId();
+            ModuleRevisionId mrid = data.getRequestedDependencyRevisionId(dd);
             mrid = convertM2IdForResourceSearch(mrid);
             ResolvedResource rres = findResourceUsingPatterns(mrid, getIvyPatterns(),
                 DefaultArtifact.newPomArtifact(mrid, data.getDate()), getRMDParser(dd, data), data

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/ResolverSettings.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/ResolverSettings.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/ResolverSettings.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/ResolverSettings.java Sun Mar  2 00:50:33 2008
@@ -20,6 +20,7 @@
 import java.util.Collection;
 
 import org.apache.ivy.core.cache.RepositoryCacheManager;
+import org.apache.ivy.core.module.id.ModuleId;
 import org.apache.ivy.plugins.latest.LatestStrategy;
 import org.apache.ivy.plugins.namespace.Namespace;
 import org.apache.ivy.plugins.parser.ParserSettings;
@@ -46,6 +47,8 @@
     void configureRepositories(boolean b);
 
     VersionMatcher getVersionMatcher();
+    
+    String getResolveMode(ModuleId moduleId);
 
     void filterIgnore(Collection names);
 

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyDeliverTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyDeliverTest.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyDeliverTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyDeliverTest.java Sun Mar  2 00:50:33 2008
@@ -106,8 +106,10 @@
                 .getModuleRevisionId());
         DependencyDescriptor[] dds = md.getDependencies();
         assertEquals(1, dds.length);
-        assertEquals(ModuleRevisionId.newInstance("org1", "mod1.2", "2.2"), dds[0]
-                .getDependencyRevisionId());
+        assertEquals(ModuleRevisionId.newInstance("org1", "mod1.2", "2.2"), 
+            dds[0].getDependencyRevisionId());
+        assertEquals(ModuleRevisionId.newInstance("org1", "mod1.2", "latest.integration"), 
+            dds[0].getDynamicConstraintDependencyRevisionId());
     }
 
     public void testWithResolveId() throws Exception {

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=632723&r1=632722&r2=632723&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 Sun Mar  2 00:50:33 2008
@@ -22,8 +22,10 @@
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
@@ -2520,6 +2522,66 @@
         assertFalse(report.hasError());
 
         assertTrue(getArchiveFileInCache("org6", "mod6.2", "2.0", "mod6.2", "jar", "jar").exists());
+    }
+
+    public void testResolveModeDynamic1() throws Exception {
+        // mod1.1;1.0.1 -> mod1.2;2.0|latest.integration
+        ResolveReport report = ivy.resolve(new File(
+                "test/repositories/1/org1/mod1.1/ivys/ivy-1.0.1.xml").toURL(),
+            getResolveOptions(new String[] {"default"})
+            .setResolveMode(ResolveOptions.RESOLVEMODE_DYNAMIC));
+        assertNotNull(report);
+
+        ModuleRevisionId depId = ModuleRevisionId.newInstance("org1", "mod1.2", "2.2");
+
+        ConfigurationResolveReport crr = report.getConfigurationReport("default");
+        assertEquals(1, crr.getDownloadReports(depId).length);
+
+        assertTrue(getIvyFileInCache(depId).exists());
+        assertTrue(getArchiveFileInCache("org1", "mod1.2", "2.2", "mod1.2", "jar", "jar").exists());
+    }
+
+    public void testResolveModeDynamic2() throws Exception {
+        // same as ResolveModeDynamic1, but resolve mode is set in settings
+        Map attributes = new HashMap();
+        attributes.put("organisation", "org1");
+        attributes.put("module", "mod1.2");
+        ivy.getSettings().addModuleConfiguration(
+            attributes, ExactPatternMatcher.INSTANCE, null, null, null, ResolveOptions.RESOLVEMODE_DYNAMIC);
+        ResolveReport report = ivy.resolve(new File(
+                "test/repositories/1/org1/mod1.1/ivys/ivy-1.0.1.xml").toURL(),
+            getResolveOptions(new String[] {"default"}));
+        assertNotNull(report);
+
+        ModuleRevisionId depId = ModuleRevisionId.newInstance("org1", "mod1.2", "2.2");
+
+        ConfigurationResolveReport crr = report.getConfigurationReport("default");
+        assertEquals(1, crr.getDownloadReports(depId).length);
+
+        assertTrue(getIvyFileInCache(depId).exists());
+        assertTrue(getArchiveFileInCache("org1", "mod1.2", "2.2", "mod1.2", "jar", "jar").exists());
+    }
+
+    public void testResolveModeDefaultOverrideSettings() throws Exception {
+        // same as ResolveModeDynamic2, but resolve mode is set in settings, and overriden when calling resolve
+        Map attributes = new HashMap();
+        attributes.put("organisation", "org1");
+        attributes.put("module", "mod1.2");
+        ivy.getSettings().addModuleConfiguration(
+            attributes, ExactPatternMatcher.INSTANCE, null, null, null, ResolveOptions.RESOLVEMODE_DYNAMIC);
+        ResolveReport report = ivy.resolve(new File(
+                "test/repositories/1/org1/mod1.1/ivys/ivy-1.0.1.xml").toURL(),
+            getResolveOptions(new String[] {"default"})
+            .setResolveMode(ResolveOptions.RESOLVEMODE_DEFAULT));
+        assertNotNull(report);
+
+        ModuleRevisionId depId = ModuleRevisionId.newInstance("org1", "mod1.2", "2.0");
+
+        ConfigurationResolveReport crr = report.getConfigurationReport("default");
+        assertEquals(1, crr.getDownloadReports(depId).length);
+
+        assertTrue(getIvyFileInCache(depId).exists());
+        assertTrue(getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2", "jar", "jar").exists());
     }
 
     public void testVersionRange1() throws Exception {

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=632723&r1=632722&r2=632723&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 Sun Mar  2 00:50:33 2008
@@ -163,6 +163,15 @@
         assertEquals("all", settings.getConflictManager(new ModuleId("apache", "ant")).getName());
     }
 
+    public void testResolveMode() throws Exception {
+        IvySettings settings = new IvySettings();
+        XmlSettingsParser parser = new XmlSettingsParser(settings);
+        parser.parse(XmlSettingsParserTest.class.getResource("ivysettings-resolveMode.xml"));
+
+        assertEquals("dynamic", settings.getResolveMode(new ModuleId("apache", "ivyde")));
+        assertEquals("default", settings.getResolveMode(new ModuleId("apache", "ant")));
+    }
+
     public void testCache() throws Exception {
         IvySettings settings = new IvySettings();
         XmlSettingsParser parser = new XmlSettingsParser(settings);

Added: ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-resolveMode.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-resolveMode.xml?rev=632723&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-resolveMode.xml (added)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-resolveMode.xml Sun Mar  2 00:50:33 2008
@@ -0,0 +1,24 @@
+<!--
+   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>
+	<modules>
+		<module organisation="apache" name="ivy*" matcher="glob" resolveMode="dynamic"/>
+		<module organisation="apache" name=".*" resolveMode="default"/>
+	</modules>
+</ivysettings>

Propchange: ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-resolveMode.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java Sun Mar  2 00:50:33 2008
@@ -239,6 +239,9 @@
         assertNotNull(dd);
         assertEquals("yourorg", dd.getDependencyId().getOrganisation());
         assertEquals("1.1", dd.getDependencyRevisionId().getRevision());
+        assertEquals("1+", dd.getDynamicConstraintDependencyRevisionId().getRevision());
+        assertEquals("yourorg#yourmodule1;1+", dd.getDynamicConstraintDependencyRevisionId().toString());
+        
         assertEquals(Arrays.asList(new String[] {"myconf1"}), Arrays.asList(dd
                 .getModuleConfigurations()));
         assertEquals(Arrays.asList(new String[] {"myconf1"}), Arrays.asList(dd

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-update-withvar.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-update-withvar.xml?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-update-withvar.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-update-withvar.xml Sun Mar  2 00:50:33 2008
@@ -60,7 +60,7 @@
 	<dependencies>
 		<dependency name="${mymodule2}" rev="${mymodule2rev}"/>
 		<dependency name="mymodule3" rev="2.0" changing="${changing}" transitive="${transitive}"/>
-		<dependency org="yourorg" name="yourmodule1" rev="1.1" conf="${myvar}"/>
+		<dependency org="yourorg" name="yourmodule1" rev="1.1" revConstraint="1+" conf="${myvar}"/>
 		<dependency org="yourorg" name="yourmodule2" rev="2+" conf="myconf1->yourconf1"/>
 		<dependency org="yourorg" name="yourmodule3" rev="3.1" conf="myconf1->yourconf1, yourconf2"/>
 		<dependency org="yourorg" name="yourmodule4" rev="4.1" conf="myconf1, myconf2->yourconf1, yourconf2"/>

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-update.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-update.xml?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-update.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-update.xml Sun Mar  2 00:50:33 2008
@@ -60,7 +60,7 @@
 	<dependencies>
 		<dependency name="mymodule2" rev="2.0"/>
 		<dependency name="mymodule3" rev="2.0" changing="true" transitive="false"/>
-		<dependency org="yourorg" name="yourmodule1" rev="1.1" conf="myconf1"/>
+		<dependency org="yourorg" name="yourmodule1" rev="1.1" revConstraint="1+" conf="myconf1"/>
 		<dependency org="yourorg" name="yourmodule2" rev="2+" conf="myconf1->yourconf1"/>
 		<dependency org="yourorg" name="yourmodule3" rev="3.1" conf="myconf1->yourconf1, yourconf2"/>
 		<dependency org="yourorg" name="yourmodule4" rev="4.1" conf="myconf1, myconf2->yourconf1, yourconf2"/>

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml Sun Mar  2 00:50:33 2008
@@ -43,7 +43,7 @@
 	<dependencies>
 		<dependency org="myorg" name="mymodule2" rev="2.0" conf="*->*" e:attr4="value4"/>
 		<dependency org="myorg" name="mymodule3" rev="2.0" changing="true" transitive="false" conf="*->*"/>
-		<dependency org="yourorg" name="yourmodule1" rev="1.1" conf="myconf1->myconf1"/>
+		<dependency org="yourorg" name="yourmodule1" rev="1.1" revConstraint="1+" conf="myconf1->myconf1"/>
 		<dependency org="yourorg" name="yourmodule2" rev="2+" conf="myconf1->yourconf1"/>
 		<dependency org="yourorg" name="yourmodule3" rev="3.1" conf="myconf1->yourconf1,yourconf2"/>
 		<dependency org="yourorg" name="yourmodule4" rev="4.1" conf="myconf1->yourconf1,yourconf2;myconf2->yourconf1,yourconf2"/>

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test.xml?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test.xml Sun Mar  2 00:50:33 2008
@@ -58,7 +58,7 @@
 	<dependencies>
 		<dependency name="mymodule2" rev="2.0" e:attr4="value4"/>
 		<dependency name="mymodule3" rev="2.0" changing="true" transitive="false"/>
-		<dependency org="yourorg" name="yourmodule1" rev="1.1" conf="myconf1"/>
+		<dependency org="yourorg" name="yourmodule1" rev="1.1" revConstraint="1+" conf="myconf1"/>
 		<dependency org="yourorg" name="yourmodule2" rev="2+" conf="myconf1->yourconf1"/>
 		<dependency org="yourorg" name="yourmodule3" rev="3.1" conf="myconf1->yourconf1, yourconf2"/>
 		<dependency org="yourorg" name="yourmodule4" rev="4.1" conf="myconf1, myconf2->yourconf1, yourconf2"/>

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/updated.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/updated.xml?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/updated.xml (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/updated.xml Sun Mar  2 00:50:33 2008
@@ -56,13 +56,13 @@
 	<dependencies defaultconfmapping="*->@">
 		<dependency name="mymodule2" rev="2.0"/>
 		<dependency name="mymodule3" rev="2.0" changing="true" transitive="false"/>
-		<dependency org="yourorg" name="yourmodule1" rev="1.1" conf="myconf1"/>
-		<dependency org="yourorg" name="yourmodule2" rev="2.5" conf="myconf1->yourconf1"/>
+		<dependency org="yourorg" name="yourmodule1" rev="1.1" revConstraint="1+" conf="myconf1"/>
+		<dependency org="yourorg" name="yourmodule2" rev="2.5" revConstraint="2+" conf="myconf1->yourconf1"/>
 		<dependency org="yourorg" name="yourmodule3" rev="3.1" conf="myconf1->yourconf1, yourconf2"/>
 		<dependency org="yourorg" name="yourmodule4" rev="4.1" conf="myconf1, myconf2->yourconf1, yourconf2"/>
 		<dependency org="yourorg" name="yourmodule5" rev="5.1" conf="myconf1->yourconf1;myconf2->yourconf1, yourconf2"/>
 
-		<dependency org="yourorg" name="yourmodule6" rev="6.3">
+		<dependency org="yourorg" name="yourmodule6" rev="6.3" revConstraint="latest.integration">
 			<conf name="myconf1" mapped="yourconf1"/>
 			<conf name="myconf2" mapped="yourconf1, yourconf2"/>
 		</dependency>

Modified: ant/ivy/core/trunk/test/repositories/1/org1/mod1.1/ivys/ivy-1.0.1.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/org1/mod1.1/ivys/ivy-1.0.1.xml?rev=632723&r1=632722&r2=632723&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/repositories/1/org1/mod1.1/ivys/ivy-1.0.1.xml (original)
+++ ant/ivy/core/trunk/test/repositories/1/org1/mod1.1/ivys/ivy-1.0.1.xml Sun Mar  2 00:50:33 2008
@@ -24,6 +24,6 @@
 	       publication="20041201120000"
 	/>
 	<dependencies>
-		<dependency name="mod1.2" rev="2.0"/>
+		<dependency name="mod1.2" rev="2.0" revConstraint="latest.integration"/>
 	</dependencies>
 </ivy-module>



Mime
View raw message