Skip to content

Commit 0bc302a

Browse files
committed
Maven Ant tasks has been EOLed (https://maven.apache.org/ant-tasks/). Switch to Maven Artficat
Resolver Ant tasks instead (https://maven.apache.org/resolver-ant-tasks/)
1 parent 84a9179 commit 0bc302a

File tree

3 files changed

+26
-21
lines changed

3 files changed

+26
-21
lines changed

fetch.xml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Set -Ddest=LOCATION on the command line
9898

9999

100100
<target name="macros" depends="pick-dest,get-m2"
101-
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
101+
xmlns:resolver="antlib:org.apache.maven.resolver.ant">
102102
<fail>
103103
Cannot execute multiple targets due to the bug in Maven Ant tasks
104104
<condition>
@@ -119,16 +119,21 @@ Set -Ddest=LOCATION on the command line
119119
</not>
120120
</condition>
121121
</fail>
122-
<artifact:dependencies pathID="@{archive}.path" useScope="runtime">
123-
<dependency groupId="@{project}"
124-
artifactId="@{archive}"
125-
version="${@{archive}.version}">
126-
<!-- exclude dependencies of ant-antunit (they should be in optional scope) -->
127-
<exclusion groupId="org.apache.ant" artifactId="ant"/>
128-
<exclusion groupId="org.apache.ant" artifactId="ant-launcher"/>
129-
</dependency>
130-
<artifact:remoteRepository url="@{repository}" id="@{id}"/>
131-
</artifact:dependencies>
122+
<resolver:remoterepo url="@{repository}" id="@{id}"/>
123+
<resolver:resolve>
124+
<dependencies id="@{archive}.path">
125+
<dependency groupId="@{project}"
126+
artifactId="@{archive}"
127+
version="${@{archive}.version}"
128+
scope="runtime">
129+
<!-- exclude dependencies of ant-antunit (they should be in optional scope) -->
130+
<exclusion groupId="org.apache.ant" artifactId="ant"/>
131+
<exclusion groupId="org.apache.ant" artifactId="ant-launcher"/>
132+
</dependency>
133+
</dependencies>
134+
<!-- create a path containing all these resolved dependencies -->
135+
<path refid="@{archive}.path"/>
136+
</resolver:resolve>
132137
<!-- now we are left with the problem of getting the files into our directory -->
133138
<copy todir="${dest.dir}">
134139
<path refid="@{archive}.path"/>

get-m2.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@
4848
<property file="get-m2.properties" />
4949

5050
<property name="m2.antlib.resource"
51-
value="org/apache/maven/artifact/ant/antlib.xml" />
51+
value="org/apache/maven/resolver/ant/antlib.xml" />
5252

5353
<property name="m2.antlib.uri"
54-
value="antlib:org.apache.maven.artifact.ant" />
54+
value="antlib:org.apache.maven.resolver.ant" />
5555

5656
<macrodef name="require">
5757
<attribute name="property" />
@@ -100,7 +100,7 @@
100100
</target>
101101

102102
<target name="checksum-mismatch" depends="validate-m2-checksum"
103-
if="m2.sha1.checksum" unless="checksum.equal">
103+
if="m2.sha1.checksum" unless="${checksum.equal}">
104104
<delete file="${m2.artifact}" />
105105
<fail>
106106
Failed to verify the downloaded file ${m2.antlib.url}" against the checksum
@@ -116,6 +116,6 @@
116116
</target>
117117

118118
<target name="get-m2" depends="checksum-match"
119-
description="Download the Maven2 Ant tasks" />
119+
description="Download the Maven Artifact Resolver Ant tasks" />
120120

121121
</project>

lib/libraries.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
# This file declares the libraries for use in a given release of the components
1717

1818
# If you change this, change the checksum to match
19-
m2.version=2.1.3
20-
m2.url=https://archive.apache.org/dist/maven/ant-tasks
21-
m2.artifact-name=maven-ant-tasks
22-
m2.jar.name=${m2.artifact-name}-${m2.version}.jar
19+
m2.version=1.4.0
20+
m2.url=https://repo1.maven.org/maven2/org/apache/maven/resolver
21+
m2.artifact-name=maven-resolver-ant-tasks
22+
m2.jar.name=${m2.artifact-name}-${m2.version}-uber.jar
2323
#this is the URL of the antlib library, that is pulled down for everything else.
24-
m2.antlib.url=${m2.url}/${m2.version}/binaries/${m2.jar.name}
24+
m2.antlib.url=${m2.url}/${m2.artifact-name}/${m2.version}/${m2.jar.name}
2525
#this is the sha1 checksum of the artifact
26-
m2.sha1.checksum=b09be554228d66d208e5fef5266844aacf443abc
26+
m2.sha1.checksum=c4642858aa22465650ad2a469b24e22696177441
2727

2828
# Repository to use by default for fetching dependencies.
2929
m2.repo=https://repo1.maven.org/maven2/

0 commit comments

Comments
 (0)