Created
October 15, 2012 16:44
-
-
Save is/3893532 to your computer and use it in GitHub Desktop.
Gradle read package information from POM file
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
defaultTasks 'hello' | |
repositories { | |
mavenCentral() | |
} | |
configurations { | |
mavenAntTasks | |
} | |
dependencies { | |
mavenAntTasks 'org.apache.maven:maven-ant-tasks:2.1.3' | |
} | |
task hello << { | |
ant.taskdef( | |
resource: 'org/apache/maven/artifact/ant/antlib.xml', | |
uri: 'antlib:org.apache.maven.artifact.ant', | |
classpath: configurations.mavenAntTasks.asPath) | |
ant.'antlib:org.apache.maven.artifact.ant:pom'(id:'mypom', file:'pom.xml') | |
println ant.references['mypom'].version | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment