I'm trying to get all the dependencies I've configured in my build in order to solve the problem explained here. My problem is that I have some dependency that have more than one artifact (for example a .zip and a .jar). When I use configurations.compile.allDependencies.each I obtain an object of type DefaultExternalModuleDependency. From this object I can easily get groupId, version and artifact id but it seems not possible to get the type (the extension) that I've defined in the dependencies closure with @zip
How can I get it?
UPDATE:
This is what I'm doing:
dependencies {
publish 'myorg:myart:1.9.4'
}
...
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
configurations.publish.allDependencies.each{
["zip","txt"].each { type ->
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
dependencyNode.appendNode('type', type)
}
}
}
}
By now, having always a .zip and a .txt file stored as artifact I resolved with an ["zip","txt"].each closure, but it remains a simplified way.
Thanks, Michele.