Apache Maven Install Plugin
The Install Plugin is used during the install
phase to add artifact(s) to the local repository. The Install Plugin uses the information in the POM (groupId, artifactId, version) to determine the proper location for the artifact within the local repository.
The local repository is the local cache where all artifacts needed for the build are stored. By default, it is located within the user's home directory (~/.m2/repository)
but the location can be configured in ~/.m2/settings.xml
using the <localRepository>
element.
Goals Overview
The Install Plugin has 3 goals:
- install:install is used to automatically install the project's main artifact (the JAR, WAR or EAR), its POM and any attached artifacts (sources, javadoc, etc) produced by a particular project.
- install:install-file is mostly used to install an externally created artifact into the local repository, along with its POM. In that case the project information can be taken from an optionally specified pomFile, but can also be given using command line parameters.
- install:help displays help information on maven-install-plugin.
Important Note for Version 3.0.0+
The install:install goal no longer supports creating checksums via -DcreateChecksum=true
. Details can be found in MINSTALL-143.
Usage
General instructions for using the Install Plugin can be found on the usage page. Some more specific use cases are described in the examples given below.
If you have questions about the plugin's usage, read the FAQ and feel free to contact the user mailing list. Posts to the mailing list are archived and could already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching the mail archive.
If you think the plugin is missing a feature or has a defect, you can file a feature request or bug report in our issue tracker. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our source repository and will find supplementary information in the guide to helping with Maven.
Examples
To provide you with a better understanding of some usages of the Maven Install Plugin, you can take a look into the following examples: