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
}