ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r1127291 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java
Date Tue, 24 May 2011 21:07:58 GMT
Author: maartenc
Date: Tue May 24 21:07:57 2011
New Revision: 1127291

URL: http://svn.apache.org/viewvc?rev=1127291&view=rev
Log:
IMPROVEMENT: ivy:makepom now honors exclusion of artifacts in generated pom files (IVY-1294)
(thanks to Jens Rohloff)

Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=1127291&r1=1127290&r2=1127291&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue May 24 21:07:57 2011
@@ -92,6 +92,7 @@ for detailed view of each issue, please 
 	Geoff Reedy
 	Torkild U. Resheim
 	Christian Riege
+	Jens Rohloff
 	Andreas Sahlbach
 	Brian Sanders
 	Adrian Sandor
@@ -124,6 +125,7 @@ for detailed view of each issue, please 
 - NEW: Import Bushel into Ivy core (IVY-1241)
 - NEW: An new resolver 'mirroredurl' which can handle a list of mirrored URL repositories
 
+- IMPROVEMENT: ivy:makepom now honors exclusion of artifacts in generated pom files (IVY-1294)
(thanks to Jens Rohloff)
 - IMPROVEMENT: Added support for dynamic revisions in <extends> tag (IVY-1281) (thanks
to Jean-Louis Boudart)
 - IMPROVEMENT: ivy:makepom child element dependency should support the type and classifier
attributes (IVY-1262)
 - IMPROVEMENT: ivy:retrieve can now create a path or fileset containing the retrieved artifacts
(IVY-1235)

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java?rev=1127291&r1=1127290&r2=1127291&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java
Tue May 24 21:07:57 2011
@@ -36,6 +36,7 @@ import org.apache.ivy.core.IvyContext;
 import org.apache.ivy.core.IvyPatternHelper;
 import org.apache.ivy.core.module.descriptor.Artifact;
 import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
+import org.apache.ivy.core.module.descriptor.ExcludeRule;
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.core.settings.IvySettings;
@@ -278,6 +279,10 @@ public final class PomModuleDescriptorWr
                     indent(out, indent * 3);
                     out.println("<optional>true</optional>");
                 }
+                
+                if(dds[i].canExclude()){
+                   printExclusions(dds[i].getAllExcludeRules(), out, indent);
+                }
                 indent(out, indent * 2);
                 out.println("</dependency>");
             }
@@ -289,6 +294,28 @@ public final class PomModuleDescriptorWr
         }
     }
     
+    private static void printExclusions(ExcludeRule[] exclusions, PrintWriter out, int indent
){
+        indent(out, indent * 3);
+        out.println("<exclusions>");        
+        
+        for(int i = 0; i < exclusions.length; i++ ){
+            indent(out, indent * 4);
+            out.println("<exclusion>");
+            ExcludeRule rule = exclusions[i];
+            indent(out, indent * 5);
+            out.println("<groupId>" + rule.getId().getModuleId().getOrganisation()
+ "</groupId>");
+            indent(out, indent * 5);
+            out.println("<artifactId>" + rule.getId().getModuleId().getName() + "</artifactId>");
+            indent(out, indent * 4);
+            out.println("</exclusion>"); 
+        }
+        
+        indent(out, indent * 3);
+        out.println("</exclusions>");      
+    }
+    
+    
+    
     private static DependencyDescriptor[] getDependencies(ModuleDescriptor md, 
             PomWriterOptions options) {
         String[] confs = ConfigurationUtils.replaceWildcards(options.getConfs(), md);



Mime
View raw message