Skip to content

Instantly share code, notes, and snippets.

@agentgt
Created April 21, 2016 14:45
Show Gist options
  • Save agentgt/f82c5b8c2a240f78997ddf2df9e9c9c3 to your computer and use it in GitHub Desktop.
Save agentgt/f82c5b8c2a240f78997ddf2df9e9c9c3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env groovy
import groovy.xml.MarkupBuilder
def xml = new XmlSlurper().parse(new File(args[0]));
def sw = new StringWriter()
def b = new MarkupBuilder(sw)
def i = 0;
b.dependencyManagement() {
dependencies() {
for (m in xml.modules.module) {
if (m.text().endsWith('-bom')) continue;
dependency() {
groupId('${project.groupId}');
artifactId(m.text());
version('${project.version}');
}
}
}
}
println sw;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment