Apache Maven 1.x has reached its end of life, and is no longer supported. For more information, see the announcement. Users are encouraged to migrate to the current version of Apache Maven.

Overview

This document describes the tags that are available when using the Artifact Plug-in with Maven.

Tags

NameDescription
artifact:deploy Deploy artifact to remote repository(ies)
artifact:install Install artifact in local repository
artifact:deploy-snapshot Deploy snapshot version of artifact to remote repository (DEPRECATED: use artifact:deploy with SNAPSHOT in the project version for equivalent behaviour)
artifact:install-snapshot Install snapshot version of artifact in local repository (DEPRECATED: use artifact:install with SNAPSHOT in the project version for equivalent behaviour)

artifact:deploy

Deploy an artifact to the set of remote repositories.

Following files will be deployed to remote repository:

  1. Artifact file
  2. MD5 checksum file of this artifact
Attribute NameDescriptionOptional?
artifact The path to the artifact file No
artifactIdOverride Name to be used for the artifact (default is ${pom.id} ) Yes
type The type of the artifact (like jar or war or plugin). Type is used for computing a destination path in repository. No
project The project (POM) which produced artifact which will be deployed.

The POM contains settings (variables and context properties) that must be consulted in order to deploy artifact to a repository. These settings include:
  1. List of remote repositories where artifact will be deployed
  2. artifactId, groupId, version
  3. Individual settings for each repository
  4. Proxy server settings
  5. ...
NO

artifact:deploy-snapshot

Deploy a snapshot version of the artifact to a set of remote repositories.

During deloyment following files are put to remote repository:

  • Timestamped Artifact file
  • MD5 checksum file of timestamped artifact file
  • Artifact file with version marked as SNAPSHOT
  • MD5 checksum file of this file
  • ${artifactId}-snapshot-version

For example for artifact with artifactId = foo the following files will be transferred to the remote repository:

  • foo-20030620.124616.jar
  • foo-20030620.124616.jar.md5
  • foo-SNAPSHOT.jar
  • foo-SNAPSHOT.jar.md5
  • foo-snapshot-version

File foo-snapshot-version contains the version number (20030620.124616) that the snapshot is linked to, so that automated tools can correctly update dependencies in projects that will use this artifact.

artifact:deploy-snapshot tag uses the same set of attributes as artifact:deploy tag

artifact:install

Install an artifact in the local repository

Following files will be copied to the local repository:

  1. Artifact file
  2. MD5 checksum file of this artifact

Why should I use artifact:install when it is so easy to copy a file inside my plugin?

There are few good reason for that:

  • Although simple now, it will not necessarily remain that way in the future. e.g. When Maven runs in client-server mode information about repository content can be cached and some files from the repository can be cached in memory (e.g. POMS). Using a centralized "proxy" which copies files to the repository can play important role in this process.
  • It is as simple to use as ant:copy task, but does not require usage of Ant.
Attribute NameDescriptionOptional?
artifact The path to the artifact file No
artifactIdOverride Name to be used for the artifact (default is ${pom.id} ) Yes
type The type of the artifact (like jar or war). Type is used for computing a destination path in repository. No
project Information kept in the POM included following bits used for controling:
  • artifactId, groupId, version
  • Location of the local repository
NO

artifact:install-snapshot

Install a snapshot version of the artifact in the local repository

Following files are copied to the local repository:

  • Timestamped Artifact file
  • Artifact file with version marked as SNAPSHOT

For exaple for artifact with artifactId foo following files will be transfered to local repository:

  • foo-20030620.124616.jar
  • foo-SNAPSHOT.jar

artifact:install-snapshot tag uses the same set of attributes as artifact:install tag