Index: test/java/org/apache/ivy/plugins/parser/m2/test-write-compile-dependencies.xml
===================================================================
--- test/java/org/apache/ivy/plugins/parser/m2/test-write-compile-dependencies.xml	(revision 965401)
+++ test/java/org/apache/ivy/plugins/parser/m2/test-write-compile-dependencies.xml	(working copy)
@@ -17,10 +17,6 @@
    specific language governing permissions and limitations
    under the License.    
 -->
-<!--
-   Apache Maven 2 POM generated by Apache Ivy
-   http://ant.apache.org/ivy/
--->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
Index: test/java/org/apache/ivy/plugins/parser/m2/test-write-simple-dependencies.xml
===================================================================
--- test/java/org/apache/ivy/plugins/parser/m2/test-write-simple-dependencies.xml	(revision 965401)
+++ test/java/org/apache/ivy/plugins/parser/m2/test-write-simple-dependencies.xml	(working copy)
@@ -17,10 +17,6 @@
    specific language governing permissions and limitations
    under the License.    
 -->
-<!--
-   Apache Maven 2 POM generated by Apache Ivy
-   http://ant.apache.org/ivy/
--->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
Index: test/java/org/apache/ivy/plugins/parser/m2/test-write-packaging.xml
===================================================================
--- test/java/org/apache/ivy/plugins/parser/m2/test-write-packaging.xml	(revision 965401)
+++ test/java/org/apache/ivy/plugins/parser/m2/test-write-packaging.xml	(working copy)
@@ -17,10 +17,6 @@
    specific language governing permissions and limitations
    under the License.    
 -->
-<!--
-   Apache Maven 2 POM generated by Apache Ivy
-   http://ant.apache.org/ivy/
--->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
Index: test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriterTest.java
===================================================================
--- test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriterTest.java	(revision 965401)
+++ test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriterTest.java	(working copy)
@@ -44,7 +44,7 @@
     public void testSimple() throws Exception {
         ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(
             new IvySettings(), getClass().getResource("test-simple.pom"), false);
-        PomModuleDescriptorWriter.write(md, null, LICENSE, PomModuleDescriptorWriter.DEFAULT_MAPPING, _dest);
+        PomModuleDescriptorWriter.write(md, null, null, new String[] {"*"}, LICENSE, PomModuleDescriptorWriter.DEFAULT_CONFIGURATION, _dest);
         assertTrue(_dest.exists());
 
         String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(_dest))).replaceAll(
@@ -57,7 +57,7 @@
     public void testSimpleDependencies() throws Exception {
         ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(
             new IvySettings(), getClass().getResource("test-dependencies.pom"), false);
-        PomModuleDescriptorWriter.write(md, null, LICENSE, PomModuleDescriptorWriter.DEFAULT_MAPPING, _dest);
+        PomModuleDescriptorWriter.write(md, null, null, new String[] {"*"}, LICENSE, PomModuleDescriptorWriter.DEFAULT_CONFIGURATION, _dest);
         assertTrue(_dest.exists());
 
         String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(_dest))).replaceAll(
@@ -70,7 +70,7 @@
     public void testDependenciesWithScope() throws Exception {
         ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(
             new IvySettings(), getClass().getResource("test-dependencies-with-scope.pom"), false);
-        PomModuleDescriptorWriter.write(md, null, LICENSE, PomModuleDescriptorWriter.DEFAULT_MAPPING, _dest);
+        PomModuleDescriptorWriter.write(md, null, null, new String[] {"*"}, LICENSE, PomModuleDescriptorWriter.DEFAULT_CONFIGURATION, _dest);
         assertTrue(_dest.exists());
 
         String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(_dest))).replaceAll(
@@ -83,7 +83,7 @@
     public void testOptional() throws Exception {
         ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(
             new IvySettings(), getClass().getResource("test-optional.pom"), false);
-        PomModuleDescriptorWriter.write(md, null, LICENSE, PomModuleDescriptorWriter.DEFAULT_MAPPING, _dest);
+        PomModuleDescriptorWriter.write(md, null, null, new String[] {"*"}, LICENSE, PomModuleDescriptorWriter.DEFAULT_CONFIGURATION, _dest);
         assertTrue(_dest.exists());
 
         String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(_dest))).replaceAll(
@@ -96,7 +96,7 @@
     public void testPackaging() throws Exception {
         ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(
             new IvySettings(), getClass().getResource("test-packaging.pom"), false);
-        PomModuleDescriptorWriter.write(md, null, LICENSE, PomModuleDescriptorWriter.DEFAULT_MAPPING, _dest);
+        PomModuleDescriptorWriter.write(md, null, null, new String[] {"*"}, LICENSE, PomModuleDescriptorWriter.DEFAULT_CONFIGURATION, _dest);
         assertTrue(_dest.exists());
 
         String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(_dest))).replaceAll(
@@ -109,7 +109,7 @@
     public void testWriteCompileConfigurationOnly() throws Exception {
         ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(
             new IvySettings(), getClass().getResource("test-dependencies-with-scope.pom"), false);
-        PomModuleDescriptorWriter.write(md, new String[] {"compile"}, LICENSE, PomModuleDescriptorWriter.DEFAULT_MAPPING, _dest);
+        PomModuleDescriptorWriter.write(md, null, null, new String[] {"compile"}, LICENSE, PomModuleDescriptorWriter.DEFAULT_CONFIGURATION, _dest);
         assertTrue(_dest.exists());
 
         String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(_dest))).replaceAll(
@@ -122,7 +122,7 @@
     public void testWriteRuntimeConfigurationOnly() throws Exception {
         ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(
             new IvySettings(), getClass().getResource("test-dependencies-with-scope.pom"), false);
-        PomModuleDescriptorWriter.write(md, new String[] {"runtime"}, LICENSE, PomModuleDescriptorWriter.DEFAULT_MAPPING, _dest);
+        PomModuleDescriptorWriter.write(md, null, null, new String[] {"runtime"}, LICENSE, PomModuleDescriptorWriter.DEFAULT_CONFIGURATION, _dest);
         assertTrue(_dest.exists());
 
         String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(_dest))).replaceAll(
@@ -135,7 +135,7 @@
     public void testWriteAllConfiguration() throws Exception {
         ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(
             new IvySettings(), getClass().getResource("test-dependencies-with-scope.pom"), false);
-        PomModuleDescriptorWriter.write(md, new String[] {"*"}, LICENSE, PomModuleDescriptorWriter.DEFAULT_MAPPING, _dest);
+        PomModuleDescriptorWriter.write(md, null, null, new String[] {"*"}, LICENSE, PomModuleDescriptorWriter.DEFAULT_CONFIGURATION, _dest);
         assertTrue(_dest.exists());
 
         String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(_dest))).replaceAll(
@@ -148,7 +148,7 @@
     public void testWriteAllExceptRuntimeConfiguration() throws Exception {
         ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(
             new IvySettings(), getClass().getResource("test-dependencies-with-scope.pom"), false);
-        PomModuleDescriptorWriter.write(md, new String[] {"*", "!runtime"}, LICENSE, PomModuleDescriptorWriter.DEFAULT_MAPPING, _dest);
+        PomModuleDescriptorWriter.write(md, null, null, new String[] {"*", "!runtime"}, LICENSE, PomModuleDescriptorWriter.DEFAULT_CONFIGURATION, _dest);
         assertTrue(_dest.exists());
 
         String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(_dest))).replaceAll(
Index: test/java/org/apache/ivy/plugins/parser/m2/test-write-dependencies-optional.xml
===================================================================
--- test/java/org/apache/ivy/plugins/parser/m2/test-write-dependencies-optional.xml	(revision 965401)
+++ test/java/org/apache/ivy/plugins/parser/m2/test-write-dependencies-optional.xml	(working copy)
@@ -17,10 +17,6 @@
    specific language governing permissions and limitations
    under the License.    
 -->
-<!--
-   Apache Maven 2 POM generated by Apache Ivy
-   http://ant.apache.org/ivy/
--->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
Index: test/java/org/apache/ivy/plugins/parser/m2/test-write-simple.xml
===================================================================
--- test/java/org/apache/ivy/plugins/parser/m2/test-write-simple.xml	(revision 965401)
+++ test/java/org/apache/ivy/plugins/parser/m2/test-write-simple.xml	(working copy)
@@ -17,10 +17,6 @@
    specific language governing permissions and limitations
    under the License.    
 -->
-<!--
-   Apache Maven 2 POM generated by Apache Ivy
-   http://ant.apache.org/ivy/
--->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
Index: test/java/org/apache/ivy/plugins/parser/m2/test-write-dependencies-with-scope.xml
===================================================================
--- test/java/org/apache/ivy/plugins/parser/m2/test-write-dependencies-with-scope.xml	(revision 965401)
+++ test/java/org/apache/ivy/plugins/parser/m2/test-write-dependencies-with-scope.xml	(working copy)
@@ -17,10 +17,6 @@
    specific language governing permissions and limitations
    under the License.    
 -->
-<!--
-   Apache Maven 2 POM generated by Apache Ivy
-   http://ant.apache.org/ivy/
--->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
Index: src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java
===================================================================
--- src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java	(revision 965401)
+++ src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java	(working copy)
@@ -22,13 +22,17 @@
 import java.io.IOException;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
+import java.util.Collection;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Iterator;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.StringTokenizer;
 
 import org.apache.ivy.Ivy;
 import org.apache.ivy.core.module.descriptor.Artifact;
@@ -47,107 +51,189 @@
 
     private PomModuleDescriptorWriter() {
     }
-    
-    public static void write(ModuleDescriptor md, String[] confs,
-            String licenseHeader, ConfigurationScopeMapping mapping, File output)
+
+    public static void write(ModuleDescriptor md, String artifactName, String artifactPackaging, String[] confs,
+                             String licenseHeader, Configuration configuration, File output)
             throws IOException {
         if (output.getParentFile() != null) {
             output.getParentFile().mkdirs();
         }
         PrintWriter out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(output),
-                "UTF-8"));
+                                                                 "UTF-8"));
         try {
             out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
             if (licenseHeader != null) {
                 out.print(licenseHeader);
+            } else {
+                out.println("<!--"); 
+                out.println("   Apache Maven 2 POM generated by Apache Ivy"); 
+                out.println("   " + Ivy.getIvyHomeURL());
+                if (addIvyVersion) {
+                    out.println("   Apache Ivy version: " + Ivy.getIvyVersion() 
+                                + " " + Ivy.getIvyDate());
+                }
+                out.println("-->");
             }
-            out.println("<!--"); 
-            out.println("   Apache Maven 2 POM generated by Apache Ivy"); 
-            out.println("   " + Ivy.getIvyHomeURL());
-            if (addIvyVersion) {
-                out.println("   Apache Ivy version: " + Ivy.getIvyVersion() 
-                    + " " + Ivy.getIvyDate());
-            }
-            out.println("-->"); 
             out.println("<project xmlns=\"http://maven.apache.org/POM/4.0.0\" "
-                    + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"");
+                        + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"");
             out.println("    xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 "
-                    + "http://maven.apache.org/maven-v4_0_0.xsd\">\n");
+                        + "http://maven.apache.org/maven-v4_0_0.xsd\">\n");
             out.println("  <modelVersion>4.0.0</modelVersion>");
-            printModuleId(md, out);
-            printDependencies(md, confs, mapping, out);
+            
+            printModuleId(md, artifactName, artifactPackaging, out);
+            printDependencies(md, confs, configuration, out);
+            
             out.println("</project>");
         } finally {
             out.close();
         }
     }
 
-    private static void printModuleId(ModuleDescriptor md, PrintWriter out) {
+    private static void printModuleId(ModuleDescriptor md, String artifactName, String artifactPackaging, PrintWriter out) {
         ModuleRevisionId mrid = md.getModuleRevisionId();
+        Artifact artifact = findArtifact(md, artifactName, artifactPackaging);
+        
         out.println("  <groupId>" + mrid.getOrganisation() + "</groupId>");
-        out.println("  <artifactId>" + mrid.getName() + "</artifactId>");
         
-        String type;
-        
-        Artifact artifact = findArtifact(md);
-        if (artifact == null) {
-            // no suitable artifact found, default to 'pom'
-            type = "pom";
+        if (artifactName != null && artifactPackaging != null) {
+            out.println("  <artifactId>" + artifactName + "</artifactId>");
+            out.println("  <packaging>" + artifactPackaging + "</packaging>");
         } else {
-            type = artifact.getType();
+            String name;
+            if (artifact == null) {
+                // no suitable artifact found, default to module name
+                name = mrid.getName();
+            } else {
+                name = artifact.getName();
+            }
+            
+            out.println("  <artifactId>" + name + "</artifactId>");
+            
+            String type;
+            if (artifact == null) {
+                // no suitable artifact found, default to 'pom'
+                type = "pom";
+            } else {
+                type = artifact.getType();
+            }
+            
+            out.println("  <packaging>" + type + "</packaging>");
         }
-
-        out.println("  <packaging>" + type + "</packaging>");
+        
         if (mrid.getRevision() != null) {
             out.println("  <version>" + mrid.getRevision() + "</version>");
         }
-        if (md.getHomePage() != null) {
-            out.println("  <url>" + md.getHomePage() + "</url>");
+        
+        String homePage = null;
+        
+        if (artifact != null && artifact.getUrl() != null) {
+            homePage = artifact.getUrl().toString();
         }
+        
+        if (homePage == null) {
+            homePage = md.getHomePage();
+        }
+        
+        if (homePage != null) {
+            out.println("  <url>" + homePage + "</url>");
+        }
     }
     
     /**
      * Returns the first artifact with the correct name and without a classifier.
      */
-    private static Artifact findArtifact(ModuleDescriptor md) {
+    private static Artifact findArtifact(ModuleDescriptor md, String artifactName, String artifactPackaging) {
         Artifact[] artifacts = md.getAllArtifacts();
         for (int i = 0; i < artifacts.length; i++) {
-            if (artifacts[i].getName().equals(md.getModuleRevisionId().getName())
+            if (artifactName != null) {
+                if (artifacts[i].getName().equals(artifactName)) {
+                    if (artifactPackaging == null || (artifactPackaging.equals(artifacts[i].getExt()))) {
+                        return artifacts[i];
+                    }
+                }
+            } else {
+                if (artifacts[i].getName().equals(md.getModuleRevisionId().getName())
                     && artifacts[i].getAttribute("classifier") == null) {
-                return artifacts[i];
+                    return artifacts[i];
+                }
             }
         }
         
         return null;
     }
 
-    private static void printDependencies(
-            ModuleDescriptor md, String[] confs, ConfigurationScopeMapping mapping, PrintWriter out) {
+    private static void printDependencies(ModuleDescriptor md, String[] confs, Configuration configuration, PrintWriter out) {
         DependencyDescriptor[] dds = getDependencies(md, confs);
-        if (dds.length > 0) {
+        
+        if ((configuration.getExtraDependencies() != null && configuration.getExtraDependencies().size() > 0) ||
+            dds.length > 0) {
             out.println("  <dependencies>");
-            for (int i = 0; i < dds.length; i++) {
-                ModuleRevisionId mrid = dds[i].getDependencyRevisionId();
+        }
+
+        if (configuration.getExtraDependencies() != null && configuration.getExtraDependencies().size() > 0) {
+            ModuleRevisionId mrid = md.getModuleRevisionId();
+            for (Iterator iter = configuration.getExtraDependencies().iterator(); iter.hasNext();) {
+                Configuration.ExtraDependency dependency = (Configuration.ExtraDependency) iter.next();
+                
                 out.println("    <dependency>");
-                out.println("      <groupId>" + mrid.getOrganisation() + "</groupId>");
-                out.println("      <artifactId>" + mrid.getName() + "</artifactId>");
-                out.println("      <version>" + mrid.getRevision() + "</version>");
-                String scope = mapping.getScope(dds[i].getModuleConfigurations());
-                if (scope != null) {
-                    out.println("      <scope>" + scope + "</scope>");
+                
+                String group = dependency.getGroup();
+                if (group == null) {
+                    group = mrid.getOrganisation();
+                    
                 }
-                if (mapping.isOptional(dds[i].getModuleConfigurations())) {
+                out.println("      <groupId>" + group + "</groupId>");
+                
+                out.println("      <artifactId>" + dependency.getArtifact() + "</artifactId>");
+                
+                String version = dependency.getVersion();
+                if (version == null) {
+                    version = mrid.getRevision();
+                }
+                if (version != null) {
+                    out.println("      <version>" + version + "</version>");
+                }
+                
+                if (dependency.getScope() != null) {
+                    out.println("      <scope>" + dependency.getScope() + "</scope>");
+                }
+                if (dependency.isOptional()) {
                     out.println("      <optional>true</optional>");
                 }
+                
                 out.println("    </dependency>");
             }
+        }
+        
+        if (dds.length > 0) {
+            for (int i = 0; i < dds.length; i++) {
+                if (configuration.isIncluded(dds[i].getModuleConfigurations())) {
+                    ModuleRevisionId mrid = dds[i].getDependencyRevisionId();
+                    out.println("    <dependency>");
+                    out.println("      <groupId>" + mrid.getOrganisation() + "</groupId>");
+                    out.println("      <artifactId>" + mrid.getName() + "</artifactId>");
+                    out.println("      <version>" + mrid.getRevision() + "</version>");
+                    String scope = configuration.getScope(dds[i].getModuleConfigurations());
+                    if (scope != null) {
+                        out.println("      <scope>" + scope + "</scope>");
+                    }
+                    if (configuration.isOptional(dds[i].getModuleConfigurations())) {
+                        out.println("      <optional>true</optional>");
+                    }
+                    out.println("    </dependency>");
+                }
+            }
+        }
+        
+        if ((configuration.getExtraDependencies() != null && configuration.getExtraDependencies().size() > 0) ||
+            dds.length > 0) {
             out.println("  </dependencies>");
         }
     }
     
     private static DependencyDescriptor[] getDependencies(ModuleDescriptor md, String[] confs) {
         confs = ConfigurationUtils.replaceWildcards(confs, md);
-
+        
         List result = new ArrayList();
         DependencyDescriptor[] dds = md.getDependencies();
         for (int i = 0; i < dds.length; i++) {
@@ -160,24 +246,44 @@
         return (DependencyDescriptor[]) result.toArray(new DependencyDescriptor[result.size()]);
     }
     
-    public static final ConfigurationScopeMapping DEFAULT_MAPPING 
-        = new ConfigurationScopeMapping(new HashMap() {
+    public static final Configuration DEFAULT_CONFIGURATION = new Configuration(null, new HashMap() {
             {
-                put("compile, runtime", "compile");
+                put("compile", "compile");
                 put("runtime", "runtime");
                 put("provided", "provided");
                 put("test", "test");
                 put("system", "system");
             }
-        });
+        }, null);
 
-    public static class ConfigurationScopeMapping {
-        private Map/*<String,String>*/ scopes;
+    public static class Configuration {
+        private Map/*<String,String>*/ scopes = null;
+        private Set/*<String>*/ configurations = null;
+        private boolean includeAll = false;
+        private Collection dependencies;
         
-        public ConfigurationScopeMapping(Map/*<String,String>*/ scopesMapping) {
+        public Configuration(String confs,
+                             Map/*<String,String>*/ scopesMapping,
+                             Collection dependencies) {
             this.scopes = new HashMap(scopesMapping);
+            this.configurations = new HashSet();
+            this.dependencies = dependencies;
+            
+            if (confs != null) {
+                if ("*".equals(confs)) {
+                    includeAll = true;
+                } else {
+                    StringTokenizer st = new StringTokenizer(confs, ",");
+                    while (st.hasMoreTokens()) {
+                        String conf = st.nextToken().trim();
+                        configurations.add(conf);
+                    }
+                }
+            } else {
+                includeAll = true;
+            }
         }
-
+        
         /**
          * Returns the scope mapped to the given configuration array.
          * 
@@ -185,10 +291,69 @@
          * @return the scope to which the conf is mapped
          */
         public String getScope(String[] confs) {
-            return (String) scopes.get(StringUtils.join(confs, ", "));
+            for (int i = 0; i < confs.length; i++) {
+                String conf = confs[i];
+                if (scopes.containsKey(conf)) {
+                    return (String)scopes.get(conf);
+                }
+            }
+            
+            return null;
         }
+        
         public boolean isOptional(String[] confs) {
             return getScope(confs) == null;
         }
+        
+        public boolean isIncluded(String[] confs) {
+            if (includeAll) {
+                return true;
+            }
+            
+            for (int i = 0; i < confs.length; i++) {
+                String conf = confs[i];
+                if (configurations.contains(conf)) {
+                    return true;
+                }
+            }
+            
+            return false;
+        }
+        
+        public Collection getExtraDependencies() {
+            return dependencies;
+        }
+        
+        public static class ExtraDependency {
+            private String group;
+            private String artifact;
+            private String version;
+            private String scope;
+            private boolean optional;
+            
+            public ExtraDependency(String group, String artifact, String version, String scope, boolean optional) {
+                this.group = group;
+                this.artifact = artifact;
+                this.version = version;
+                this.scope = scope;
+                this.optional = optional;
+            }
+            
+            public String getGroup() {
+                return group;
+            }
+            public String getArtifact() {
+                return artifact;
+            }
+            public String getVersion() {
+                return version;
+            }
+            public String getScope() {
+                return scope;
+            }
+            public boolean isOptional() {
+                return optional;
+            }
+        }
     }
 }
Index: src/java/org/apache/ivy/ant/IvyMakePom.java
===================================================================
--- src/java/org/apache/ivy/ant/IvyMakePom.java	(revision 965401)
+++ src/java/org/apache/ivy/ant/IvyMakePom.java	(working copy)
@@ -28,7 +28,8 @@
 
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
 import org.apache.ivy.plugins.parser.m2.PomModuleDescriptorWriter;
-import org.apache.ivy.plugins.parser.m2.PomModuleDescriptorWriter.ConfigurationScopeMapping;
+import org.apache.ivy.plugins.parser.m2.PomModuleDescriptorWriter.Configuration;
+import org.apache.ivy.plugins.parser.m2.PomModuleDescriptorWriter.Configuration.ExtraDependency;
 import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser;
 import org.apache.ivy.util.FileUtil;
 import org.apache.tools.ant.BuildException;
@@ -41,6 +42,7 @@
     public class Mapping {
         private String conf;
         private String scope;
+        
         public String getConf() {
             return conf;
         }
@@ -54,37 +56,98 @@
             this.scope = scope;
         }
     }
-
+    
+    public class Dependency {
+        private String group = null;
+        private String artifact = null;
+        private String version = null;
+        private String scope = null;
+        private boolean optional = false;
+        
+        public String getGroup() {
+            return group;
+        }
+        public void setGroup(String group) {
+            this.group = group;
+        }
+        public String getArtifact() {
+            return artifact;
+        }
+        public void setArtifact(String artifact) {
+            this.artifact = artifact;
+        }
+        public String getVersion() {
+            return version;
+        }
+        public void setVersion(String version) {
+            this.version = version;
+        }
+        public String getScope() {
+            return scope;
+        }
+        public void setScope(String scope) {
+            this.scope = scope;
+        }
+        public boolean getOptional() {
+            return optional;
+        }
+        public void setOptional(boolean optional) {
+            this.optional = optional;
+        }      
+    }
+    
+    private String artifactName;
+    
+    private String artifactPackaging;
+    
     private File pomFile = null;
-
+    
     private File headerFile = null;
-
+    
     private String conf;
-   
+    
     private File ivyFile = null;
-
+    
     private Collection mappings = new ArrayList();
-
+    
+    private Collection dependencies = new ArrayList();
+    
+    public String getArtifactName() {
+        return artifactName;
+    }
+    
+    public void setArtifactName(String artifactName) {
+        this.artifactName = artifactName;
+    }
+    
+    public String getArtifactPackaging() {
+        return artifactPackaging;
+    }
+    
+    public void setArtifactPackaging(String artifactPackaging) {
+        this.artifactPackaging = artifactPackaging;
+    }
+    
     public File getPomFile() {
         return pomFile;
     }
-
+    
     public void setPomFile(File file) {
         pomFile = file;
     }
-
+    
     public File getIvyFile() {
         return ivyFile;
     }
-
+    
     public void setIvyFile(File ivyFile) {
         this.ivyFile = ivyFile;
     }
-
+    
     public File getHeaderFile() {
         return headerFile;
     }
-
+    
     public void setHeaderFile(File headerFile) {
         this.headerFile = headerFile;
     }
@@ -92,17 +155,23 @@
     public String getConf() {
         return conf;
     }
-   
+    
     public void setConf(String conf) {
         this.conf = conf;
     }
-   
+    
     public Mapping createMapping() {
         Mapping mapping = new Mapping();
         this.mappings.add(mapping);
         return mapping;
     }
     
+    public Dependency createDependency() {
+        Dependency dependency = new Dependency();
+        this.dependencies.add(dependency);
+        return dependency;
+    }
+    
     public void doExecute() throws BuildException {
         try {
             if (ivyFile == null) {
@@ -111,25 +180,25 @@
             if (pomFile == null) {
                 throw new BuildException("destination pom file is required for makepom task");
             }
-            ModuleDescriptor md = XmlModuleDescriptorParser.getInstance().parseDescriptor(
-                getSettings(), ivyFile.toURI().toURL(), false);
-            PomModuleDescriptorWriter.write(md, splitConfs(conf),
-                headerFile == null ? null : FileUtil.readEntirely(getHeaderFile()),
-                mappings.isEmpty() 
-                    ? PomModuleDescriptorWriter.DEFAULT_MAPPING
-                    : new ConfigurationScopeMapping(getMappingsMap()), pomFile);
+            ModuleDescriptor md = XmlModuleDescriptorParser.getInstance().parseDescriptor(                                                                           getSettings(), ivyFile.toURI().toURL(), false);
+            PomModuleDescriptorWriter.write(md,
+                                            artifactName, artifactPackaging, splitConfs(conf), 
+                                            headerFile == null ? null : FileUtil.readEntirely(getHeaderFile()),
+                                            mappings.isEmpty() 
+                                            ? PomModuleDescriptorWriter.DEFAULT_CONFIGURATION
+                                            : new Configuration(conf, getMappingsMap(), getDependencies()), pomFile);
         } catch (MalformedURLException e) {
             throw new BuildException("unable to convert given ivy file to url: " + ivyFile + ": "
-                    + e, e);
+                                     + e, e);
         } catch (ParseException e) {
             log(e.getMessage(), Project.MSG_ERR);
             throw new BuildException("syntax errors in ivy file " + ivyFile + ": " + e, e);
         } catch (Exception e) {
             throw new BuildException("impossible convert given ivy file to pom file: " + e
-                    + " from=" + ivyFile + " to=" + pomFile, e);
+                                     + " from=" + ivyFile + " to=" + pomFile, e);
         }
     }
-
+    
     private Map getMappingsMap() {
         Map mappingsMap = new HashMap();
         for (Iterator iter = mappings.iterator(); iter.hasNext();) {
@@ -138,4 +207,17 @@
         }
         return mappingsMap;
     }
+    
+    private Collection getDependencies() {
+        Collection result = new ArrayList();
+        for (Iterator iter = dependencies.iterator(); iter.hasNext();) {
+            Dependency dependency = (Dependency) iter.next();
+            result.add(new ExtraDependency(dependency.getGroup(),
+                                           dependency.getArtifact(),
+                                           dependency.getVersion(),
+                                           dependency.getScope(),
+                                           dependency.getOptional()));
+        }
+        return result;
+    }
 }
Index: doc/use/makepom.html
===================================================================
--- doc/use/makepom.html	(revision 965401)
+++ doc/use/makepom.html	(working copy)
@@ -42,6 +42,12 @@
         <td>Yes</td></tr>
     <tr><td>pomfile</td><td>the destination pom file to write</td>
         <td>Yes</td></tr>
+    <tr><td>artifactName</td><td>the name of the artifact which is represented by the generated pom file</td>
+      <td>No, the module name defined in info is taken by default.</td></tr>
+    <tr><td>artifactPackaging</td><td>the packaging of the artifact which is represented by the generated pom file</td>
+      <td>No, the artifact ext is taken by default. If none is defined then 'jar' is used</td></tr>
+    <tr><td>headerFile</td><td>the header of the generated pom file</td>
+      <td>No</td></tr>
     <tr><td>conf</td><td>a comma separated list of the configurations to include in the generated pom. Wildcards are supported here. <span class="since">(since 2.2)</span></td><td>No, defaults to all configurations.</td></tr>
 <tr><td>settingsRef</td><td>A reference to the ivy settings that must be used by this task</td><td>No, 'ivy.instance' is taken by default.</td></tr>
 </tbody>
@@ -53,20 +59,25 @@
 </thead>
 <tbody>
     <tr><td>mapping</td>
-        <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>describes the mapping from an Ivy module configuration to a Maven POM scope.<br/>These elements takes three attributes: <ul><li>conf</li> the configuration to map<li>scope</li>the scope to which it should be mapped</ul><li>nowhere</li> the configuration shouldn't 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>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>0..n</td></tr>
 </tbody>
 </table>
 
 <h1>Examples</h1>
 <code type="xml">
-<ivy:makepom ivyfile="${basedir}/path/to/ivy.xml" pomfile="${basedir}/path/to/module.pom">
+<ivy:makepom ivyfile="${basedir}/path/to/ivy.xml" pomfile="${basedir}/path/to/module.pom" conf="default,runtime">
    <mapping conf="default" scope="compile"/>
    <mapping conf="runtime" scope="runtime"/>
+   <dependency group="com.acme" artifact="acme-logging" version="1.0" optional="true"/>
 </ivy:makepom>
 </code>
-Converts ${basedir}/path/to/ivy.xml to a pom and writes the result to ${basedir}/path/to/module.pom. The configuration 'default' in the parsed ivy file will be mapped to the scope 'compile', the configuration 'runtime' will be mapped to 'runtime', and other configurations will be considered optional.
+Converts ${basedir}/path/to/ivy.xml to a pom and writes the result to ${basedir}/path/to/module.pom. The configuration 'default' in the parsed ivy file will be mapped to the scope 'compile', the configuration 'runtime' will be mapped to 'runtime', and other configurations will be excluded.
 
+The <i>com.acme.acme-logging</i> artifact with version 1.0 will be added as an optional dependency.
 	</textarea>
 <script type="text/javascript">xooki.postProcess();</script>
 </body>
