Added generatePom task

This can be used to generate the pom.xml for adding the Spring Security
snapshot jars as a Maven Dependency to another project. For example,
if mywebapp requires the Spring Security 3.1.4.CI-SNAPSHOT jars one
could generate the pom.xml files and then use that to convert the project
into a valid Maven project within the IDE. Then the SNAPSHOT dependendies
could be added to mywebapp. This prevents the need to install the SNAPSHOT
dependencies in the local Maven repository.
This commit is contained in:
Rob Winch 2012-11-01 11:22:41 -05:00
parent 78cbdd2c93
commit c0dfb70ca0
1 changed files with 17 additions and 0 deletions

View File

@ -95,3 +95,20 @@ def customizePom(pom, gradleProject) {
}
}
}
task generatePom {
group = 'Build'
description = 'Generates the Maven pom.xml'
ext.generatedPomFileName = 'pom.xml'
inputs.files('**/*.gradle')
outputs.files(generatedPomFileName)
doLast() {
def p = pom {}
customizePom(p, project)
p.writeTo(generatedPomFileName)
}
}