ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r692729 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/plugins/parser/m2/ test/java/org/apache/ivy/plugins/parser/m2/
Date Sat, 06 Sep 2008 20:32:49 GMT
Author: maartenc
Date: Sat Sep  6 13:32:48 2008
New Revision: 692729

URL: http://svn.apache.org/viewvc?rev=692729&view=rev
Log:
FIX: Ivy ibiblio resolver chokes on variables while checking descriptor consistency (IVY-818)

Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-parent-properties.pom
    ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-version.pom

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=692729&r1=692728&r2=692729&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Sat Sep  6 13:32:48 2008
@@ -111,6 +111,7 @@
 - IMPROVEMENT: Add a memory cache for the module descriptor that are parsed from the cache
(IVY-883)
 - IMPROVEMENT: Improve performance (IVY-872)
 
+- FIX: Ivy ibiblio resolver chokes on variables while checking descriptor consistency (IVY-818)
 - FIX: Enable consistent support of the configuration negation operator (IVY-894) (thanks
to Patrick Woodworth)
 - FIX: add variable expansion in extra attributes (IVY-798)
 - FIX: Invalid URL when using dynamic ranges (IVY-885)

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java?rev=692729&r1=692728&r2=692729&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
Sat Sep  6 13:32:48 2008
@@ -328,7 +328,7 @@
     public void addPlugin(PomDependencyMgt plugin) {
         String pluginValue = plugin.getGroupId() + EXTRA_INFO_DELIMITER + plugin.getArtifactId()

                 + EXTRA_INFO_DELIMITER + plugin.getVersion();
-        String pluginExtraInfo = (String) ivyModuleDescriptor.getExtraInfo().get("maven.plugins");
+        String pluginExtraInfo = (String) ivyModuleDescriptor.getExtraInfo().get("m:maven.plugins");
         if (pluginExtraInfo == null) {
             pluginExtraInfo = pluginValue;
         } else {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java?rev=692729&r1=692728&r2=692729&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
Sat Sep  6 13:32:48 2008
@@ -111,10 +111,33 @@
         PomModuleDescriptorBuilder mdBuilder = new PomModuleDescriptorBuilder(this, res);
         
         try {           
-            PomReader domReader = new PomReader(descriptorURL, res);
-            
+            PomReader domReader = new PomReader(descriptorURL, res);            
             domReader.setProperty("parent.version", domReader.getParentVersion());
             
+            ModuleDescriptor parentDescr = null;
+            if (domReader.hasParent()) {
+                //Is there any other parent properties?
+                
+                ModuleRevisionId parentModRevID = ModuleRevisionId.newInstance(
+                    domReader.getParentGroupId(), 
+                    domReader.getParentArtifactId(), 
+                    domReader.getParentVersion());
+                ResolvedModuleRevision parentModule = parseOtherPom(ivySettings, 
+                    parentModRevID);
+                if (parentModule != null) {
+                    parentDescr = parentModule.getDescriptor();
+                } else {
+                   Message.warn("impossible to load parent for " + descriptorURL + "."
+                       + " Parent=" + parentModRevID); 
+                }
+                
+                Map parentPomProps = PomModuleDescriptorBuilder.extractPomProperties(parentDescr.getExtraInfo());
+                for (Iterator iter = parentPomProps.entrySet().iterator(); iter.hasNext();)
{
+                    Map.Entry prop = (Map.Entry) iter.next();
+                    domReader.setProperty((String) prop.getKey(), (String) prop.getValue());
+                }                    
+            }
+                            
             String groupId = domReader.getGroupId();
             String artifactId = domReader.getArtifactId();
             String version = domReader.getVersion();
@@ -172,25 +195,6 @@
                 domReader.setProperty("pom.version", version);
                 domReader.setProperty("version", version);
 
-                ModuleDescriptor parentDescr = null;
-                if (domReader.hasParent()) {
-                    domReader.setProperty("parent.version", domReader.getParentVersion());
-                    //Is there any other parent properties?
-                    
-                    ModuleRevisionId parentModRevID = ModuleRevisionId.newInstance(
-                        domReader.getParentGroupId(), 
-                        domReader.getParentArtifactId(), 
-                        domReader.getParentVersion());
-                    ResolvedModuleRevision parentModule = parseOtherPom(ivySettings, 
-                        parentModRevID);
-                    if (parentModule != null) {
-                        parentDescr = parentModule.getDescriptor();
-                    } else {
-                       Message.warn("impossible to load parent for " + descriptorURL + "."
-                           + " Parent=" + parentModRevID); 
-                    }
-                }
-                                
                 Map pomProperties = domReader.getPomProperties();
                 for (Iterator iter = pomProperties.entrySet().iterator(); iter.hasNext();)
{
                     Map.Entry prop = (Map.Entry) iter.next();
@@ -199,13 +203,6 @@
                 }
                 
                 if (parentDescr != null) {
-                    Map parentPomProps = PomModuleDescriptorBuilder
-                            .extractPomProperties(parentDescr.getExtraInfo());
-                    for (Iterator iter = parentPomProps.entrySet().iterator(); iter.hasNext();)
{
-                        Map.Entry prop = (Map.Entry) iter.next();
-                        domReader.setProperty((String) prop.getKey(), (String) prop.getValue());
-                    }                    
-
                     mdBuilder.addExtraInfos(parentDescr.getExtraInfo());
                     
                     // add dependency management info from parent

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java?rev=692729&r1=692728&r2=692729&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
(original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
Sat Sep  6 13:32:48 2008
@@ -606,7 +606,8 @@
         ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(
             settings, getClass().getResource("test-parent-properties.pom"), false);
         assertNotNull(md);
-
+        assertEquals("1.0", md.getRevision());
+        
         DependencyDescriptor[] dds = md.getDependencies();
         assertNotNull(dds);
         assertEquals(3, dds.length); 

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-parent-properties.pom
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-parent-properties.pom?rev=692729&r1=692728&r2=692729&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-parent-properties.pom
(original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-parent-properties.pom
Sat Sep  6 13:32:48 2008
@@ -27,7 +27,7 @@
   <groupId>org.apache</groupId>
   <artifactId>test</artifactId>
   <name>Test Module for Ivy M2 parsing</name>
-  <version>1.0</version>
+  <version>${test-version-version}</version>
   <url>http://ivy.jayasoft.org/</url>
   <organization>
     <name>Jayasoft</name>

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-version.pom
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-version.pom?rev=692729&r1=692728&r2=692729&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-version.pom (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-version.pom Sat Sep
 6 13:32:48 2008
@@ -42,5 +42,6 @@
   </dependencies>
   <properties>
   	<test-yet-other-version>5.76</test-yet-other-version>
+        <test-version-version>1.0</test-version-version>
   </properties>
 </project>



Mime
View raw message