title: Usage author:
Apache Maven has a two-level strategy to resolve and distribute files. These files are the artifacts. The local repository is the first level. It is the artifact cache on your system. The default location is ${user.home}/.m2/repository. Maven looks in the local cache for artifacts first.
If Maven cannot find an artifact, it will access the remote repositories. Maven stores the artifact in the local repository once it finds it. The artifact is then available for current and future usage.
With the maven-install-plugin, you can put your artifacts in the local repository. To upload artifacts to a remote repository, use the maven-deploy-plugin.
install:install goalIn most cases, the install:install goal needs no configuration. It needs the project POM and the artifact file. It runs during the install phase of the default build lifecycle.
mvn install
install:install-file goalThe install:install-file goal installs artifacts that Maven did not build into the local repository. The development team can provide a POM for the artifact. The POM is not required. The following list shows the available parameters for the install-file goal:
mvn install:install-file -Dfile=your-artifact-1.0.jar \ [-DpomFile=your-pom.xml] \ [-Dsources=src.jar] \ [-Djavadoc=apidocs.jar] \ [-DgroupId=org.some.group] \ [-DartifactId=your-artifact] \ [-Dversion=1.0] \ [-Dpackaging=jar] \ [-Dclassifier=sources] \ [-DgeneratePom=true] \ [-DcreateChecksum=true]
classifier parameter installs a secondary artifact, for example a javadoc or sources JAR. See Installing Secondary Artifacts for more information. If you do not give a classifier, Maven treats the file as the main artifact.