In the 2020s and with recent versions of Maven (3.x), you should not need to worry about plugin version and repository URL anymore and be able to just do:

mvn dependency:get -Dartifact=group-id:artefact-id:version

Original answer

You could use the maven dependency plugin which has a nice dependency:get goal since version 2.1. No need for a pom, everything happens on the command line.

To make sure to find the dependency:get goal, you need to explicitly tell maven to use the version 2.1, i.e. you need to use the fully qualified name of the plugin, including the version:

mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get \
    -DrepoUrl=url \
    -Dartifact=groupId:artifactId:version

UPDATE: With older versions of Maven (prior to 2.1), it is possible to run dependency:get normally (without using the fully qualified name and version) by forcing your copy of maven to use a given version of a plugin.

This can be done as follows:

1. Add the following line within the <settings> element of your ~/.m2/settings.xml file:

<usePluginRegistry>true</usePluginRegistry>

2. Add the file ~/.m2/plugin-registry.xml with the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<pluginRegistry xsi:schemaLocation="http://maven.apache.org/PLUGIN_REGISTRY/1.0.0 http://maven.apache.org/xsd/plugin-registry-1.0.0.xsd"
xmlns="http://maven.apache.org/PLUGIN_REGISTRY/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-dependency-plugin</artifactId>
      <useVersion>2.1</useVersion>
      <rejectedVersions/>
    </plugin>
  </plugins>
</pluginRegistry>

But this doesn't seem to work anymore with maven 2.1/2.2. Actually, according to the Introduction to the Plugin Registry, features of the plugin-registry.xml have been redesigned (for portability) and the plugin registry is currently in a semi-dormant state within Maven 2. So I think we have to use the long name for now (when using the plugin without a pom, which is the idea behind dependency:get).

Answer from Pascal Thivent on Stack Overflow
๐ŸŒ
Apache Maven
maven.apache.org โ€บ download.cgi
Download Apache Maven โ€“ Maven
Apache Maven Daemon (mvnd) is available as a separate download.
Installation
Apache Maven can be installed by most package managers, or manually by downloading the archive and adding it to your path. You need a Java Development Kit (JDK) installed. Either set the JAVA_HOME environment variable to the path of your JDK installation or have the java executable on your PATH.
Release Notes
The Apache Maven team maintains the last version of the last two series of GA releases.
What is Maven?
Maven aims to gather current principles for best practices development and make it easy to guide a project in that direction. For example, specification, execution, and reporting of unit tests are part of the normal build cycle using Maven.
Maven Plugins
Reporting plugins will be executed during the site generation and they should be configured in the <reporting/> element from the POM. Because the result of a Reporting plugin is part of the generated site, Reporting plugins should be both internationalized and localized. You can read more about the localization of our plugins and how you can help. To see the most up-to-date list browse the Maven ...
๐ŸŒ
Apache Maven
maven.apache.org โ€บ install.html
Installation - Apache Maven
5 days ago - Apache Maven can be installed by most package managers, or manually by downloading the archive and adding it to your path. You need a Java Development Kit (JDK) installed. Either set the JAVA_HOME environment variable to the path of your JDK installation or have the java executable on your PATH.
Top answer
1 of 14
276

In the 2020s and with recent versions of Maven (3.x), you should not need to worry about plugin version and repository URL anymore and be able to just do:

mvn dependency:get -Dartifact=group-id:artefact-id:version

Original answer

You could use the maven dependency plugin which has a nice dependency:get goal since version 2.1. No need for a pom, everything happens on the command line.

To make sure to find the dependency:get goal, you need to explicitly tell maven to use the version 2.1, i.e. you need to use the fully qualified name of the plugin, including the version:

mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get \
    -DrepoUrl=url \
    -Dartifact=groupId:artifactId:version

UPDATE: With older versions of Maven (prior to 2.1), it is possible to run dependency:get normally (without using the fully qualified name and version) by forcing your copy of maven to use a given version of a plugin.

This can be done as follows:

1. Add the following line within the <settings> element of your ~/.m2/settings.xml file:

<usePluginRegistry>true</usePluginRegistry>

2. Add the file ~/.m2/plugin-registry.xml with the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<pluginRegistry xsi:schemaLocation="http://maven.apache.org/PLUGIN_REGISTRY/1.0.0 http://maven.apache.org/xsd/plugin-registry-1.0.0.xsd"
xmlns="http://maven.apache.org/PLUGIN_REGISTRY/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-dependency-plugin</artifactId>
      <useVersion>2.1</useVersion>
      <rejectedVersions/>
    </plugin>
  </plugins>
</pluginRegistry>

But this doesn't seem to work anymore with maven 2.1/2.2. Actually, according to the Introduction to the Plugin Registry, features of the plugin-registry.xml have been redesigned (for portability) and the plugin registry is currently in a semi-dormant state within Maven 2. So I think we have to use the long name for now (when using the plugin without a pom, which is the idea behind dependency:get).

2 of 14
125

With the latest version (2.8) of the Maven Dependency Plugin, downloading an artifact from the Maven Central Repository is as simple as:

mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:get -Dartifact=groupId:artifactId:version[:packaging[:classifier]]

where groupId:artifactId:version, etc. are the Maven coordinates

An example, tested with Maven 2.0.9, Maven 2.2.1, and Maven 3.0.4:

mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:get -Dartifact=org.hibernate:hibernate-entitymanager:3.4.0.GA:jar:sources

(Thanks to Pascal Thivent for providing his wonderful answer in the first place. I am adding another answer, because it wouldn't fit in a comment and it would be too extensive for an edit.)

๐ŸŒ
QACRAFT -
qacraft.com โ€บ home โ€บ software testing โ€บ how to download and install maven?
How to Download and Install Maven? - QACRAFT
January 28, 2026 - Once the Java installation is complete, use a new terminal to install Maven. Navigate to the opt directory by entering the command i.e. โ€œcd /optโ€ ยท Then execute the wget command along with the link copied above i.e.โ€ wget *link of tar.gz archive*โ€ ยท After downloading the Maven tar ...
๐ŸŒ
Apache Maven
maven.apache.org โ€บ guides โ€บ getting-started โ€บ windows-prerequisites.html
Maven on Windows โ€“ Maven
To do this conveniently, ${maven.home}\bin must be in your PATH, just like the Java SDK commands. You can add directories to your PATH in the control panel; the details vary by Windows version. Firewall and Anti-virus sometimes prevent Java from running properly, or Windows Firewall (and various other Firewalls) actively prevent Java.exe from reaching out to the Internet to โ€œdownload stuffโ€ which is a key part of Maven.
๐ŸŒ
CodeJava
codejava.net โ€บ tools โ€บ maven โ€บ install-maven-on-windows
Download and Install Maven on Windows
July 31, 2022 - Then youโ€™ll learn how to create and build a simple Java project using Maven.NOTE: you must have JDK pre-installed in order to run Maven command line tool. If not, kindly follow this guide. Click this link to visit the official download page of Maven. Then click the link next to โ€œBinary ...
๐ŸŒ
Baeldung
baeldung.com โ€บ home โ€บ maven โ€บ how to install maven on windows, linux, and mac
How to Install Maven on Windows, Linux, and Mac | Baeldung
May 11, 2024 - The installation of Apache Maven is a simple process of extracting the archive followed by configuring Maven such that the mvn executable is available in the OS classpath. Maven is written in Java. So, to run Maven, we need a system that has Java installed and configured properly. We can download ...
๐ŸŒ
PhoenixNAP
phoenixnap.com โ€บ home โ€บ kb โ€บ sysadmin โ€บ how to install maven on windows
How to Install Maven on Windows {Step-by-Step Guide}
July 31, 2025 - 1. Visit the Maven download page and download the version of Maven you want to install. The Files section contains the archives of the latest version.
Find elsewhere
Top answer
1 of 5
85

If the file is a Maven dependency, you could use the Maven Dependency Plugin which has a get goal.

For any file, you could use the Antrun plugin to call Ant's Get task.

Another option would be the maven-download-plugin, it has been precisely created to facilitate this kind of things. It's not very actively developed and the documentation only mentions an artifact goal that does exactly the same thing as dependency:get but.. If you look at the sources, you'll see that is has a WGet mojo that will do the job.

Use it like this in any POM:

Copy<plugin>
  <groupId>com.googlecode.maven-download-plugin</groupId>
  <artifactId>download-maven-plugin</artifactId>
  <version>1.3.0</version>
  <executions>
    <execution>
      <!-- the wget goal actually binds itself to this phase by default -->
      <phase>process-resources</phase>
      <goals>
        <goal>wget</goal>
      </goals>
      <configuration>
        <url>http://url/to/some/file</url>
        <outputFileName>foo.bar</outputFileName>
        <!-- default target location, just to demonstrate the parameter -->
        <outputDirectory>${project.build.directory}</outputDirectory>
      </configuration>
    </execution>
  </executions>
</plugin>

Key benefits of this plugin are caching of the download and checking against a signature, such as MD5.

Note that this answer has been heavily updated to reflect changes in the plugin as noted in the comments.

2 of 5
36

Seems like wagon-maven-plugin from CodeHaus allows to download files over HTTP (though this is not is original goal).

Here is an example downloading GlassFish zip before integration tests:

Copy<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>wagon-maven-plugin</artifactId>
    <version>1.0</version>
    <executions>
        <execution>
            <id>download-glassfish</id>
            <phase>pre-integration-test</phase>
            <goals>
                <goal>download-single</goal>
            </goals>
            <configuration>
                <url>http://download.java.net</url>
                <fromFile>glassfish/3.1/release/glassfish-3.1.zip</fromFile>
                <toDir>${project.build.directory}/glassfish</toDir>
            </configuration>
        </execution>
    </executions>
</plugin>
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ how-to-install-apache-maven-on-windows
How to Install Apache Maven on Windows? - GeeksforGeeks
1. Click on the Download button. 2. Click on the apache-maven-3.8.4-bin.zip button. 3. Now check for the executable file in downloads in your system ยท 4. Now right-click on the file and click on extract here to extract the file. 5. After extracting, you get the extracted folder.
Published ย  April 1, 2025
๐ŸŒ
TheServerSide
theserverside.com โ€บ video โ€บ Install-Maven-on-Windows
Install Maven on Windows | TheServerSide
It's not hard to get started with Apache Maven. Maven is packaged and distributed as a zip file, so installation of the tool simply involves the following steps: Download the Apache Maven zip file.
๐ŸŒ
Medium
medium.com โ€บ @gauravshah97 โ€บ how-to-install-maven-on-windows-39ff317e40cf
How to Install Maven on Windows. Maven is a popular open-source buildโ€ฆ | by Gaurav Shah | Medium
April 13, 2024 - Open a web browser and go to Maven Download Page. 2. Click on the appropriate link to download the binary zip archive of the latest version of Maven.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ installation guide โ€บ how-to-install-apache-maven-on-windows-macos-and-linux
Installation of Apache Maven - GeeksforGeeks
1. Click on the Download button. 2. Click on the apache-maven-3.8.4-bin.zip button. 3. Now check for the executable file in downloads in your system ยท 4. Now right-click on the file and click on extract here to extract the file. 5. After extracting, you get the extracted folder.
Published ย  August 4, 2025
๐ŸŒ
CyberPanel
cyberpanel.net โ€บ blog โ€บ apache-maven-download
Detailed Apache Maven Download Guide
February 5, 2026 - A command-line interface (CLI) ... the current Java Development Kit (JDK) (e.g., JDK 17 or newer). ... Navigate to the official Apache Maven download page....
๐ŸŒ
Thedevjournal
thedevjournal.blog โ€บ mastering-series โ€บ apache-maven โ€บ 01-getting-started โ€บ 04-installation-windows โ€บ index.html
Installing Maven - Windows :: The Developer Journal
April 12, 2026 - The latest Apache Maven version ... equally applicable to other versions, as well. The first step is to download the Apache Maven from the official website....
๐ŸŒ
Mkyong
mkyong.com โ€บ home โ€บ maven โ€บ how to install maven on windows
How to install Maven on Windows - Mkyong.com
November 7, 2018 - i have an error while running mvn ... ... Download Binary zip archive instead of Source zip archive from https://maven.apache.org/download.cgi....
๐ŸŒ
HowToDoInJava
howtodoinjava.com โ€บ home โ€บ maven โ€บ installing maven on windows
How to Install Maven on Windows - HowToDoInJava
October 1, 2022 - Learn to install maven on a Windows 11 machine for Java build and dependency management activities. Steps are the same for Windows 10.
๐ŸŒ
Apache Maven
maven.apache.org
Welcome to Apache Maven โ€“ Maven
Using a project object model (POM), Maven manages a project's compilation, testing, and documentation.