[GRADLE-1238] POM generated by Maven plugin includes wrong artifactId in case of ProjectDependency Created: 29/Nov/10 Updated: 04/Jan/13 Resolved: 28/Nov/12
If a given project depends on another one which customizes artifact base name or specifies more than one artifact build specification, as in:
then the generated pom.xml for these dependencies sets the archive names as their artifactId. Unfortunately, generated pom.xml for the dependent project uses project names nevertheless.
I'm not perfectly sure if this is a bug, i.e. if this use case cannot be satisfied by defining dependencies in some other way. However, this dependency configuration works for all the other plugins, so I think that if it needs tweaking for maven-plugin, then it should be described in the configuration.
I've edited subprojects/gradle-core/src/test/groovy/org/gradle/api/internal/artifacts/publish/maven/dependencies/DefaultPomDependenciesConverterTest.java to add a test that presents this scenario. Also note that the equals function implemented in this class is totally broken (it compares lhs with itself).
I've also extended subprojects/gradle-core/src/test/groovy/org/gradle/api/internal/artifacts/publish/maven/dependencies/DefaultPomDependenciesConverter.java with a solution that works OK for a given scenario.
Both files can be found in the following branch of my GitHub fork: https://github.com/anowak/gradle/tree/wrongArchiveNamesInPom