Browse Source

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/)
master
Jaikiran Pai 3 years ago
parent
commit
0bc302a60f
3 changed files with 26 additions and 21 deletions
  1. +16
    -11
      fetch.xml
  2. +4
    -4
      get-m2.xml
  3. +6
    -6
      lib/libraries.properties

+ 16
- 11
fetch.xml View File

@@ -98,7 +98,7 @@ Set -Ddest=LOCATION on the command line


<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>
Cannot execute multiple targets due to the bug in Maven Ant tasks
<condition>
@@ -119,16 +119,21 @@ Set -Ddest=LOCATION on the command line
</not>
</condition>
</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 -->
<copy todir="${dest.dir}">
<path refid="@{archive}.path"/>


+ 4
- 4
get-m2.xml View File

@@ -48,10 +48,10 @@
<property file="get-m2.properties" />

<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"
value="antlib:org.apache.maven.artifact.ant" />
value="antlib:org.apache.maven.resolver.ant" />

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

<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}" />
<fail>
Failed to verify the downloaded file ${m2.antlib.url}" against the checksum
@@ -116,6 +116,6 @@
</target>

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

</project>

+ 6
- 6
lib/libraries.properties View File

@@ -16,14 +16,14 @@
# This file declares the libraries for use in a given release of the components

# 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.
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
m2.sha1.checksum=b09be554228d66d208e5fef5266844aacf443abc
m2.sha1.checksum=c4642858aa22465650ad2a469b24e22696177441

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


Loading…
Cancel
Save