How do I download a plugin from a remote Archiva repository?
Author: Deron Eriksson
Description: This maven tutorial describes how to download a plugin from a remote Archiva repository.
Tutorial created using: Windows XP || JDK 1.5.0_09 || Eclipse Web Tools Platform 2.0 (Eclipse 3.3.0)

In another tutorial, I deployed a snapshot of a mavenSW plugin called "maven-howdy-plugin" to a remote ArchivaS maven repository on my intranet so that other developers could use the plugin. Now, I'd like to use that plugin on a project called "aproject" on another machine, so I'd like to download it.

In the "aproject" project's pom.xml file, I need to specify the location of the plugin repository. It's located in the Archiva snapshots repository, so I'll include a reference to this repository in my pom.xml file. In addition, I added a reference to the "maven-howdy-plugin" plugin in the pom.xml file. (I also associated the "howdy-world" goal with the validate phase of the maven default lifecycle for this project).


<project xmlns="" xmlns:xsi=""

Now, I'll perform a "mvn clean" on the "aproject" project.

Executing 'mvn clean' on 'aproject'

The console output of the "mvn clean" command is shown below. The "maven-howdy-plugin" 1.0-SNAPSHOT jarW file isn't in the local maven repository on this computer, so it gets downloaded to the local maven repository, as you can see from the console output.

Console output from 'mvn clean' on 'aproject' project

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building aproject
[INFO]    task-segment: [clean]
[INFO] ------------------------------------------------------------------------
[INFO] artifact org.apache.maven.plugins:maven-clean-plugin: checking for updates from archiva.snapshots
[INFO] snapshot com.maventest:maven-howdy-plugin:1.0-SNAPSHOT: checking for updates from archiva.snapshots
1K downloaded
2K downloaded
[INFO] [clean:clean]
[INFO] Deleting directory C:\projects\workspace\aproject\target
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Mon Feb 18 18:39:02 PST 2008
[INFO] Final Memory: 3M/5M
[INFO] ------------------------------------------------------------------------

That's all there is to it! We needed to specify the plugin repository in our pom.xml file. In addition, we needed to specify the desired plugin in the pom.xml file. When we executed a "mvn clean" on the project, maven saw the reference to the plugin, so it downloaded it from the specified plugin repository.

For further information, you may want to investigate some of the options that can be specified in the plugin repository reference in pom.xml, such as the differences between enabling "releases" and "snapshots".