Resolver Ant tasks instead (https://maven.apache.org/resolver-ant-tasks/)master
@@ -98,7 +98,7 @@ Set -Ddest=LOCATION on the command line | |||||
<target name="macros" depends="pick-dest,get-m2" | <target name="macros" depends="pick-dest,get-m2" | ||||
xmlns:artifact="antlib:org.apache.maven.artifact.ant"> | |||||
xmlns:resolver="antlib:org.apache.maven.resolver.ant"> | |||||
<fail> | <fail> | ||||
Cannot execute multiple targets due to the bug in Maven Ant tasks | Cannot execute multiple targets due to the bug in Maven Ant tasks | ||||
<condition> | <condition> | ||||
@@ -119,16 +119,21 @@ Set -Ddest=LOCATION on the command line | |||||
</not> | </not> | ||||
</condition> | </condition> | ||||
</fail> | </fail> | ||||
<artifact:dependencies pathID="@{archive}.path" useScope="runtime"> | |||||
<dependency groupId="@{project}" | |||||
artifactId="@{archive}" | |||||
version="${@{archive}.version}"> | |||||
<!-- exclude dependencies of ant-antunit (they should be in optional scope) --> | |||||
<exclusion groupId="org.apache.ant" artifactId="ant"/> | |||||
<exclusion groupId="org.apache.ant" artifactId="ant-launcher"/> | |||||
</dependency> | |||||
<artifact:remoteRepository url="@{repository}" id="@{id}"/> | |||||
</artifact:dependencies> | |||||
<resolver:remoterepo url="@{repository}" id="@{id}"/> | |||||
<resolver:resolve> | |||||
<dependencies id="@{archive}.path"> | |||||
<dependency groupId="@{project}" | |||||
artifactId="@{archive}" | |||||
version="${@{archive}.version}" | |||||
scope="runtime"> | |||||
<!-- exclude dependencies of ant-antunit (they should be in optional scope) --> | |||||
<exclusion groupId="org.apache.ant" artifactId="ant"/> | |||||
<exclusion groupId="org.apache.ant" artifactId="ant-launcher"/> | |||||
</dependency> | |||||
</dependencies> | |||||
<!-- create a path containing all these resolved dependencies --> | |||||
<path refid="@{archive}.path"/> | |||||
</resolver:resolve> | |||||
<!-- now we are left with the problem of getting the files into our directory --> | <!-- now we are left with the problem of getting the files into our directory --> | ||||
<copy todir="${dest.dir}"> | <copy todir="${dest.dir}"> | ||||
<path refid="@{archive}.path"/> | <path refid="@{archive}.path"/> | ||||
@@ -48,10 +48,10 @@ | |||||
<property file="get-m2.properties" /> | <property file="get-m2.properties" /> | ||||
<property name="m2.antlib.resource" | <property name="m2.antlib.resource" | ||||
value="org/apache/maven/artifact/ant/antlib.xml" /> | |||||
value="org/apache/maven/resolver/ant/antlib.xml" /> | |||||
<property name="m2.antlib.uri" | <property name="m2.antlib.uri" | ||||
value="antlib:org.apache.maven.artifact.ant" /> | |||||
value="antlib:org.apache.maven.resolver.ant" /> | |||||
<macrodef name="require"> | <macrodef name="require"> | ||||
<attribute name="property" /> | <attribute name="property" /> | ||||
@@ -100,7 +100,7 @@ | |||||
</target> | </target> | ||||
<target name="checksum-mismatch" depends="validate-m2-checksum" | <target name="checksum-mismatch" depends="validate-m2-checksum" | ||||
if="m2.sha1.checksum" unless="checksum.equal"> | |||||
if="m2.sha1.checksum" unless="${checksum.equal}"> | |||||
<delete file="${m2.artifact}" /> | <delete file="${m2.artifact}" /> | ||||
<fail> | <fail> | ||||
Failed to verify the downloaded file ${m2.antlib.url}" against the checksum | Failed to verify the downloaded file ${m2.antlib.url}" against the checksum | ||||
@@ -116,6 +116,6 @@ | |||||
</target> | </target> | ||||
<target name="get-m2" depends="checksum-match" | <target name="get-m2" depends="checksum-match" | ||||
description="Download the Maven2 Ant tasks" /> | |||||
description="Download the Maven Artifact Resolver Ant tasks" /> | |||||
</project> | </project> |
@@ -16,14 +16,14 @@ | |||||
# This file declares the libraries for use in a given release of the components | # This file declares the libraries for use in a given release of the components | ||||
# If you change this, change the checksum to match | # If you change this, change the checksum to match | ||||
m2.version=2.1.3 | |||||
m2.url=https://archive.apache.org/dist/maven/ant-tasks | |||||
m2.artifact-name=maven-ant-tasks | |||||
m2.jar.name=${m2.artifact-name}-${m2.version}.jar | |||||
m2.version=1.4.0 | |||||
m2.url=https://repo1.maven.org/maven2/org/apache/maven/resolver | |||||
m2.artifact-name=maven-resolver-ant-tasks | |||||
m2.jar.name=${m2.artifact-name}-${m2.version}-uber.jar | |||||
#this is the URL of the antlib library, that is pulled down for everything else. | #this is the URL of the antlib library, that is pulled down for everything else. | ||||
m2.antlib.url=${m2.url}/${m2.version}/binaries/${m2.jar.name} | |||||
m2.antlib.url=${m2.url}/${m2.artifact-name}/${m2.version}/${m2.jar.name} | |||||
#this is the sha1 checksum of the artifact | #this is the sha1 checksum of the artifact | ||||
m2.sha1.checksum=b09be554228d66d208e5fef5266844aacf443abc | |||||
m2.sha1.checksum=c4642858aa22465650ad2a469b24e22696177441 | |||||
# Repository to use by default for fetching dependencies. | # Repository to use by default for fetching dependencies. | ||||
m2.repo=https://repo1.maven.org/maven2/ | m2.repo=https://repo1.maven.org/maven2/ | ||||