Skip to content

Instantly share code, notes, and snippets.

@tophyr
Created June 24, 2015 20:37
Show Gist options
  • Save tophyr/b0cd998271da7216c6af to your computer and use it in GitHub Desktop.
Save tophyr/b0cd998271da7216c6af to your computer and use it in GitHub Desktop.
pom.withXml {
def newDep = asNode().dependencies[0].appendNode 'dependency'
def g = newDep.appendNode 'groupId'
g.setValue(project.group)
def a = newDep.appendNode 'artifactId'
a.setValue('version_plugin')
def v = newDep.appendNode 'version'
v.setValue(project.version)
def s = newDep.appendNode 'scope'
s.setValue('runtime')
}
pom.withXml {
asNode().dependencies.appendNode {
dependency {
groupId { project.group }
artifactId { 'version_plugin' }
version { project.version }
scope { 'runtime' }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment