Skip to content

Instantly share code, notes, and snippets.

@leonelag
Last active December 11, 2015 17:19
Show Gist options
  • Save leonelag/4633601 to your computer and use it in GitHub Desktop.
Save leonelag/4633601 to your computer and use it in GitHub Desktop.
Use Ant to download dependencies from Maven repositories.
<?xml version="1.0" encoding="UTF-8"?>
<!-- ======================================================================
Dependency download
Downloads dependencies from Maven repositories.
Maven-ant-tasks jar:
http://www.apache.org/dyn/closer.cgi/maven/ant-tasks/2.1.3/binaries/maven-ant-tasks-2.1.3.jar
Tasks documentation:
http://maven.apache.org/ant-tasks/
====================================================================== -->
<project name="MyProject"
xmlns:mvn="antlib:org.apache.maven.artifact.ant">
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="antlib:org.apache.maven.artifact.ant"
classpath="lib/maven-ant-tasks-2.1.3.jar" />
<!-- =================================
target: download-deps
================================= -->
<target name="download-deps"
description="Downloads dependencies from Maven repositories.">
<mvn:dependencies filesetId="dependency.classpath">
<!--
List your dependencies here. Remember to set the scope accordingly.
-->
<dependency groupId="org.mockejb"
artifactId="mockejb"
version="0.6-beta2"
scope="compile"/>
</mvn:dependencies>
<copy todir="lib/">
<fileset refid="dependency.classpath" />
</copy>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment