Index: test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java =================================================================== --- test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java (revision 835571) +++ test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java (working copy) @@ -441,7 +441,8 @@ assertEquals(3, dds.length); assertEquals(ModuleRevisionId.newInstance("commons-logging", "commons-logging", "1.0.4"), dds[0].getDependencyRevisionId()); - assertEquals(new HashSet(Arrays.asList(new String[] {"optional"})), new HashSet(Arrays + assertEquals(new HashSet(Arrays.asList(new String[] {"optional", "transitive-sources", + "transitive-javadoc"})), new HashSet(Arrays .asList(dds[0].getModuleConfigurations()))); //I don't know what it should be. Ivy has no notion of optional dependencies //assertEquals(new HashSet(Arrays.asList(new String[] {"compile(*)", "runtime(*)", @@ -480,7 +481,8 @@ assertEquals(3, dds.length); assertEquals(ModuleRevisionId.newInstance("odmg", "odmg", "3.0"), dds[0] .getDependencyRevisionId()); - assertEquals(new HashSet(Arrays.asList(new String[] {"runtime"})), new HashSet(Arrays + assertEquals(new HashSet(Arrays.asList(new String[] {"runtime", "transitive-sources", + "transitive-javadoc"})), new HashSet(Arrays .asList(dds[0].getModuleConfigurations()))); assertEquals(new HashSet(Arrays.asList(new String[] {"compile(*)", "runtime(*)", "master(*)"})), new HashSet(Arrays.asList(dds[0] @@ -518,8 +520,9 @@ assertEquals(3, dds.length); assertEquals(ModuleRevisionId.newInstance("commons-logging", "commons-logging", "1.0.4"), dds[0].getDependencyRevisionId()); - assertEquals(new HashSet(Arrays.asList(new String[] {"compile", "runtime"})), new HashSet( - Arrays.asList(dds[0].getModuleConfigurations()))); + assertEquals(new HashSet(Arrays.asList(new String[] {"compile", "runtime", + "transitive-sources", "transitive-javadoc"})), new HashSet(Arrays.asList(dds[0] + .getModuleConfigurations()))); assertEquals(new HashSet(Arrays.asList(new String[] {"master(*)", "compile(*)"})), new HashSet(Arrays.asList(dds[0].getDependencyConfigurations("compile")))); assertEquals(new HashSet(Arrays.asList(new String[] {"runtime(*)"})), new HashSet(Arrays @@ -621,7 +624,7 @@ dds[0].getDependencyRevisionId()); assertEquals("There is no special artifact when there is no classifier", 0, dds[0].getAllDependencyArtifacts().length); - assertEquals("The number of configurations is incorrect", 1, dds[0].getModuleConfigurations().length); + assertEquals("The number of configurations is incorrect", 3, dds[0].getModuleConfigurations().length); assertEquals("The configuration must be test", "test", dds[0].getModuleConfigurations()[0]); } Index: src/java/org/apache/ivy/plugins/resolver/BasicResolver.java =================================================================== --- src/java/org/apache/ivy/plugins/resolver/BasicResolver.java (revision 835571) +++ src/java/org/apache/ivy/plugins/resolver/BasicResolver.java (working copy) @@ -218,14 +218,16 @@ } checkInterrupted(); - + + // try to find a descriptor of the module ResolvedResource ivyRef = findIvyFileRef(nsDd, data); checkInterrupted(); - // get module descriptor ModuleDescriptor nsMd; ModuleDescriptor systemMd = null; if (ivyRef == null) { + // no module descriptor found in the repository, let's have a default one, + // if allowed, based on the first artifact found. if (!isAllownomd()) { throw new UnresolvedDependencyException( "\t" + getName() + ": no ivy file found for " + systemMrid, false); @@ -258,6 +260,7 @@ systemMd.getAllArtifacts()[0], null, getCacheOptions(data)); } } else { + // module descriptor found, let's parse it if (ivyRef instanceof MDResolvedResource) { rmr = ((MDResolvedResource) ivyRef).getResolvedModuleRevision(); } Index: src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java =================================================================== --- src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java (revision 835571) +++ src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java (working copy) @@ -100,11 +100,19 @@ + "looked up in a repository.", new String[0], true, null), new Configuration("sources", Visibility.PUBLIC, - "this configuration contains the source artifact of this module, if any.", - new String[0], true, null), + "this configuration contains the source artifact of this module, if any.", + new String[0], true, null), + new Configuration("transitive-sources", Visibility.PUBLIC, + "this configuration contains the source artifact of this module and every of its " + + "transitive dependencies, if any.", + new String[] { "sources" }, true, null), new Configuration("javadoc", Visibility.PUBLIC, - "this configuration contains the javadoc artifact of this module, if any.", - new String[0], true, null), + "this configuration contains the javadoc artifact of this module, if any.", + new String[0], true, null), + new Configuration("transitive-javadoc", Visibility.PUBLIC, + "this configuration contains the javadoc artifact of this module, and every of its " + + "transitive dependencies, if any.", + new String[] { "javadoc" }, true, null), new Configuration("optional", Visibility.PUBLIC, "contains all optional dependencies", new String[0], true, null) }; @@ -294,6 +302,10 @@ scope = (scope == null || scope.length() == 0) ? getDefaultScope(dep) : scope; ConfMapper mapping = (ConfMapper) MAVEN2_CONF_MAPPING.get(scope); mapping.addMappingConfs(dd, dep.isOptional()); + + dd.addDependencyConfiguration("transitive-sources", "transitive-sources(sources)"); + dd.addDependencyConfiguration("transitive-javadoc", "transitive-javadoc(javadoc)"); + Map extraAtt = new HashMap(); if ((dep.getClassifier() != null) || (dep.getType() != null)) { String type = "jar"; Index: src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java =================================================================== --- src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java (revision 835571) +++ src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriter.java (working copy) @@ -120,8 +120,8 @@ public static final ConfigurationScopeMapping DEFAULT_MAPPING = new ConfigurationScopeMapping(new HashMap() { { - put("compile, runtime", "compile"); - put("runtime", "runtime"); + put("compile, runtime, transitive-sources, transitive-javadoc", "compile"); + put("runtime, transitive-sources, transitive-javadoc", "runtime"); put("provided", "provided"); put("test", "test"); put("system", "system");