Created
July 25, 2012 14:58
-
-
Save jlafourc/3176607 to your computer and use it in GitHub Desktop.
Modification du pom généré par gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pom.whenConfigured { pom -> | |
// dep is a native Maven dependency object (With properties artifactId, groupId, ...) | |
pom.dependencies.each { dep -> | |
dep.type = 'jar' | |
println dep | |
} | |
} | |
pom.withXml { provider -> | |
org.w3c.dom.Document document = provider.asElement().getOwnerDocument() | |
org.w3c.dom.NodeList nodeList = provider.asElement().getElementsByTagName('dependency') | |
for (i in0..nodeList.getLength()-1) { | |
org.w3c.dom.Node childNode = nodeList.item(i) | |
org.w3c.dom.Node typeNode = document.createElement("type") | |
typeNode.setTextContent('jar') | |
childNode.appendChild(typeNode) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment