On 17/07/10 12:23 AM, Levi Hoogenberg wrote:
Hi,
I'm trying to use Gradle to generate pom files, so that I can create
an online M2 repository that contains my project's artifacts.
Eventually, I'd like to use Sonatype for this, but this way seemed
less time-consuming.
Anyway, my project declares two custom configurations:
configurations {
distribution
apiDocs.extendsFrom distribution
compile.extendsFrom apiDocs
}
(All JAR files in the distribution configuration will be packaged in
the distribution zip, the apiDocs JARs form the classpath for the
Javadoc task.)
Now, when I run /gradle install/, the modules' generated pom.xmls do
contain a <dependency> element for each dependency in the compile
configuration, but none for the distribution or apiDocs
configurations' dependencies.
Is this intended behaviour?
No, this is a bug. I've added a JIRA issue for this:
http://jira.codehaus.org/browse/GRADLE-1042
Can I use some workaround to get the behaviour I would like?
You can add scope mappings for the custom configurations. Here's an example:
[install, uploadArchives].each { task ->
configure(task.repositories.all.asList()[0].pom.scopeMappings) {
addMapping(300, configurations.apiDocs, 'compile')
addMapping(300, configurations.distributions, 'compile')
}
}
--
Adam Murdoch
Gradle Developer
http://www.gradle.org
CTO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz