Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not sure if there is a Maven plugin to handle this, but it is fairly simple to use the <a href="http://maven.apache.org/ant-tasks/index.html" rel="nofollow noreferrer" title="Maven Ant Tasks">Maven Ant tasks</a> for this purpose. You don't need to have Maven or a POM file, just Ant and this build file:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;project name="mvn-get" default="get" basedir="."&gt; &lt;property name="maven.ant.tasks.jar" value="${ant.home}/lib/maven-ant-tasks-2.011.jar" /&gt; &lt;property name="maven.ant.tasks.bootstrap.location" value="http://apache.inetbridge.net/maven/binaries/maven-ant-tasks-2.0.11.jar" /&gt; &lt;available property="maven.ant.tasks.jar.exists" file="${maven.ant.tasks.jar}" /&gt; &lt;!-- This will download the "latest version" of the maven-ant-tasks if needed --&gt; &lt;target name="bootstrap_maven" unless="maven.ant.tasks.jar.exists"&gt; &lt;get src="${maven.ant.tasks.bootstrap.location}" dest="${maven.ant.tasks.jar}" /&gt; &lt;/target&gt; &lt;!-- This will initialize all the maven ant tasks and download the requested artifact and its dependencies --&gt; &lt;target name="get" depends="bootstrap_maven" xmlns:artifact="urn:maven-artifact-ant"&gt; &lt;path id="maven.ant.tasks.classpath" path="${maven.ant.tasks.jar}" /&gt; &lt;typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven.ant.tasks.classpath" /&gt; &lt;condition property="maven.repo.local" value="${maven.repo.local}" else="${user.home}/.m2/repository"&gt; &lt;isset property="maven.repo.local" /&gt; &lt;/condition&gt; &lt;echo&gt;maven.repo.local=${maven.repo.local}&lt;/echo&gt; &lt;artifact:localRepository id="local.repository" path="${maven.repo.local}" /&gt; &lt;artifact:dependencies pathId="build.classpath" sourcesFilesetId="sources.id"&gt; &lt;dependency groupId="${mvn.get.groupId}" artifactId="${mvn.get.artifactId}" version="${mvn.get.version}"/&gt; &lt;localRepository refid="local.repository" /&gt; &lt;/artifact:dependencies&gt; &lt;/target&gt; &lt;/project&gt; </code></pre> <p>Using a command line like the following will do what you want:</p> <pre><code>ant -Dmvn.get.groupId=commons-httpclient -Dmvn.get.artifactId=commons-httpclient -Dmvn.get.version=3.1 -Dmaven.repo.local=. </code></pre> <p>The inspiration for this came from this <a href="http://ptrthomas.wordpress.com/2009/03/08/why-you-should-use-the-maven-ant-tasks-instead-of-maven-or-ivy/" rel="nofollow noreferrer" title="Why you should use the Maven Ant Tasks instead of Maven or Ivy">excellent blog post.</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload