Author: maartenc
Date: Tue Feb  8 22:09:17 2011
New Revision: 1068607

URL: http://svn.apache.org/viewvc?rev=1068607&view=rev
Log:
IMPROVEMENT: ivy:makepom child element dependency should support the type and 
classifier attributes (IVY-1262)

Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/doc/use/makepom.html
    ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyMakePom.java
    
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java
    
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomWriterOptions.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=1068607&r1=1068606&r2=1068607&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Feb  8 22:09:17 2011
@@ -118,6 +118,7 @@ for detailed view of each issue, please 
 - NEW: ivy:resolve and post resole task can now have inlined dependencies 
declaration.
 - NEW: Import Bushel into Ivy core (IVY-1241)
 
+- 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)
 - IMPROVEMENT: Improve diagnostics in ssh resolver (IVY-1267) (thanks to 
Stepan Koltsov)
 - IMPROVEMENT: ivy:retrieve can now convert 'dotted'-organisation names into a 
directory tree.

Modified: ant/ivy/core/trunk/doc/use/makepom.html
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/use/makepom.html?rev=1068607&r1=1068606&r2=1068607&view=diff
==============================================================================
--- ant/ivy/core/trunk/doc/use/makepom.html (original)
+++ ant/ivy/core/trunk/doc/use/makepom.html Tue Feb  8 22:09:17 2011
@@ -109,7 +109,7 @@ ${ivy.pom.header}
         <td>describes the mapping from an Ivy module configuration to a Maven 
POM scope.<br/>These elements takes two attributes: <ul><li>conf</li> the 
configuration to map<li>scope</li>the scope to which it should be 
mapped</ul></td>
         <td>0..n</td></tr>
     <tr><td>dependency</td>
-        <td>describes extra dependencies that should be added to the generated 
Maven POM file.<br/>These elements takes the following attributes: 
<ul><li>group</li> the groupId. Default <i>organisation</i> as defined in 
<i>info</i><li>artifact</li> the name of the artifact<li>version</li> the 
version. Default <i>revision</i> as defined in <i>info</i><li>scope</li> the 
scope<li>optional</li> is the artifact optional. Default <i>false</i></ul></td>
+        <td>describes extra dependencies that should be added to the generated 
Maven POM file.<br/>These elements takes the following attributes: 
<ul><li>group</li> the groupId. Default <i>organisation</i> as defined in 
<i>info</i><li>artifact</li> the name of the artifact<li>version</li> the 
version. Default <i>revision</i> as defined in <i>info</i><li>type <span 
class="since">(since 2.3)</span></li> the type<li>classifier <span 
class="since">(since 2.3)</span></li> the classifier<li>scope</li> the 
scope<li>optional</li> is the artifact optional. Default <i>false</i></ul></td>
         <td>0..n</td></tr>
 </tbody>
 </table>

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyMakePom.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyMakePom.java?rev=1068607&r1=1068606&r2=1068607&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyMakePom.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyMakePom.java Tue Feb  8 
22:09:17 2011
@@ -63,6 +63,8 @@ public class IvyMakePom extends IvyTask 
         private String artifact = null;
         private String version = null;
         private String scope = null;
+        private String type = null;
+        private String classifier = null;
         private boolean optional = false;
         
         public String getGroup() {
@@ -89,6 +91,18 @@ public class IvyMakePom extends IvyTask 
         public void setScope(String scope) {
             this.scope = scope;
         }
+        public String getType() {
+            return type;
+        }
+        public void setType(String type) {
+            this.type = type;
+        }
+        public String getClassifier() {
+            return classifier;
+        }
+        public void setClassifier(String classifier) {
+            this.classifier = classifier;
+        }
         public boolean getOptional() {
             return optional;
         }
@@ -267,7 +281,7 @@ public class IvyMakePom extends IvyTask 
             Dependency dependency = (Dependency) iter.next();
             result.add(new 
PomWriterOptions.ExtraDependency(dependency.getGroup(),
                     dependency.getArtifact(), dependency.getVersion(), 
dependency.getScope(),
-                    dependency.getOptional()));
+                    dependency.getType(), dependency.getClassifier(), 
dependency.getOptional()));
         }
         return result;
     }

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=1068607&r1=1068606&r2=1068607&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 Feb  8 22:09:17 2011
@@ -233,6 +233,14 @@ public final class PomModuleDescriptorWr
                 }
                 indent(out, indent * 3);
                 out.println("<version>" + version + "</version>");
+                if (dep.getType() != null) {
+                    indent(out, indent * 3);
+                    out.println("<type>" + dep.getType() + "</type>");
+                }
+                if (dep.getClassifier() != null) {
+                    indent(out, indent * 3);
+                    out.println("<classifier>" + dep.getClassifier() + 
"</classifier>");
+                }
                 if (dep.getScope() != null) {
                     indent(out, indent * 3);
                     out.println("<scope>" + dep.getScope() + "</scope>");

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomWriterOptions.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomWriterOptions.java?rev=1068607&r1=1068606&r2=1068607&view=diff
==============================================================================
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomWriterOptions.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomWriterOptions.java
 Tue Feb  8 22:09:17 2011
@@ -160,13 +160,18 @@ public class PomWriterOptions {
             private String artifact;
             private String version;
             private String scope;
+            private String type;
+            private String classifier;
             private boolean optional;
             
-            public ExtraDependency(String group, String artifact, String 
version, String scope, boolean optional) {
+            public ExtraDependency(String group, String artifact, String 
version, String scope, 
+                    String type, String classifier, boolean optional) {
                 this.group = group;
                 this.artifact = artifact;
                 this.version = version;
                 this.scope = scope;
+                this.type = type;
+                this.classifier = classifier;
                 this.optional = optional;
             }
             
@@ -182,6 +187,12 @@ public class PomWriterOptions {
             public String getScope() {
                 return scope;
             }
+            public String getType() {
+                return type;
+            }
+            public String getClassifier() {
+                return classifier;
+            }
             public boolean isOptional() {
                 return optional;
             }


Reply via email to