Index: test/java/org/apache/ivy/ant/IvyResolveTest.java
===================================================================
--- test/java/org/apache/ivy/ant/IvyResolveTest.java	(révision 1094689)
+++ test/java/org/apache/ivy/ant/IvyResolveTest.java	(copie de travail)
@@ -18,7 +18,6 @@
 package org.apache.ivy.ant;
 
 import java.io.File;
-import java.util.List;
 
 import junit.framework.TestCase;
 
@@ -586,5 +585,15 @@
             // ok
         }
     }
+    
+    public void testSimpleExtends() throws Exception {
+        resolve.setFile(new File("test/java/org/apache/ivy/ant/ivy-extends-multiconf.xml"));
+        resolve.execute();
+        assertEquals("1", resolve.getProject().getProperty("ivy.parents.count"));
+        assertEquals("apache", resolve.getProject().getProperty("ivy.parent[0].organisation"));
+        assertEquals("resolve-simple", resolve.getProject().getProperty("ivy.parent[0].module"));
+        assertEquals("1.0", resolve.getProject().getProperty("ivy.parent[0].revision"));
+        assertEquals(null, resolve.getProject().getProperty("ivy.parent[0].branch"));
+    }
 
 }
Index: src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
===================================================================
--- src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java	(révision 1094689)
+++ src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java	(copie de travail)
@@ -58,6 +58,7 @@
 import org.apache.ivy.core.resolve.ResolveEngine;
 import org.apache.ivy.core.resolve.ResolveOptions;
 import org.apache.ivy.core.resolve.ResolvedModuleRevision;
+import org.apache.ivy.core.settings.IvyVariableContainer;
 import org.apache.ivy.plugins.conflict.ConflictManager;
 import org.apache.ivy.plugins.conflict.FixedConflictManager;
 import org.apache.ivy.plugins.matcher.PatternMatcher;
@@ -475,6 +476,18 @@
          */
         protected void mergeWithOtherModuleDescriptor(List/* <String> */extendTypes,
                 ModuleDescriptor parent) {
+            ModuleRevisionId parentMrid = parent.getModuleRevisionId();
+            IvyVariableContainer variables = IvyContext.getContext().getSettings().getVariableContainer();
+            int parentIndex = 0;
+            if (variables.getVariable("ivy.parents.count") != null) {
+                parentIndex= Integer.parseInt(variables.getVariable("ivy.parents.count"));
+            } 
+            variables.setVariable("ivy.parent["+parentIndex+"].organisation", parentMrid.getOrganisation(), false);
+            variables.setVariable("ivy.parent["+parentIndex+"].module", parentMrid.getName(), false);
+            variables.setVariable("ivy.parent["+parentIndex+"].revision", parentMrid.getRevision(), false);
+            variables.setVariable("ivy.parent["+parentIndex+"].branch", parentMrid.getBranch(), false);
+            parentIndex++;
+            variables.setVariable("ivy.parents.count", String.valueOf(parentIndex), true);
 
             if (extendTypes.contains("all")) {
                 mergeAll(parent);
Index: src/java/org/apache/ivy/ant/IvyResolve.java
===================================================================
--- src/java/org/apache/ivy/ant/IvyResolve.java	(révision 1094689)
+++ src/java/org/apache/ivy/ant/IvyResolve.java	(copie de travail)
@@ -18,7 +18,6 @@
 package org.apache.ivy.ant;
 
 import java.io.File;
-import java.io.IOException;
 import java.net.MalformedURLException;
 import java.text.ParseException;
 import java.util.ArrayList;
@@ -32,6 +31,7 @@
 import org.apache.ivy.core.module.descriptor.DefaultExcludeRule;
 import org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor;
 import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
+import org.apache.ivy.core.module.descriptor.ExtendsDescriptor;
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.core.report.ResolveReport;
@@ -344,6 +344,17 @@
                 settings.setVariable("ivy.module", mdName);
                 getProject().setProperty("ivy.revision", mdRev);
                 settings.setVariable("ivy.revision", mdRev);
+                
+                String parentCount=settings.getVariable("ivy.parents.count");
+                if (parentCount!=null) {
+                    getProject().setProperty("ivy.parents.count",parentCount);
+                    for (int j = 0; j < Integer.parseInt(parentCount); j++) {
+                        getProject().setProperty("ivy.parent["+j+"].organisation", settings.getVariable("ivy.parent["+j+"].organisation"));
+                        getProject().setProperty("ivy.parent["+j+"].module", settings.getVariable("ivy.parent["+j+"].module"));
+                        getProject().setProperty("ivy.parent["+j+"].revision", settings.getVariable("ivy.parent["+j+"].revision"));
+                        getProject().setProperty("ivy.parent["+j+"].branch", settings.getVariable("ivy.parent["+j+"].branch"));
+                    }
+                }
                 Boolean hasChanged = null;
                 if (getCheckIfChanged()) {
                     hasChanged = Boolean.valueOf(report.hasChanged());
Index: doc/use/resolve.html
===================================================================
--- doc/use/resolve.html	(révision 1094689)
+++ doc/use/resolve.html	(copie de travail)
@@ -54,6 +54,22 @@
 <li>ivy.deps.changed.${resolveId}</li>
 </ul>
 
+<b>Since 2.3</b>
+If current module extends other modules 
+<ul>
+<li>ivy.parents.count</li>
+number of parents module
+<li>ivy.parent[index].organisation</li>
+set to the organisation name found in the parent ivyfile which was used for resolve
+<li>ivy.parent[index].module</li>
+set to the module name found in the parent ivyfile which was used for resolve
+<li>ivy.parent[index].revision</li>
+set to the revision name found in the parent ivyfile which was used for resolve
+<li>ivy.parent[index].branch</li>
+set to the branch name found in the parent ivyfile which was used for resolve
+</ul>
+Where <i>index</i> represent the index of extends module.
+
 When ivy has finished the resolve task, it outputs a summary of what has been resolved. This summary looks like this:
 <pre>
 ---------------------------------------------------------------------
