Intro
install plugin 은 install phase 에서 동작하며 artifact 를 local repository 에 추가하는 용도로 사용된다. remote 에 deploy 할 경우는 maven deploy plugin 을 참고
Goal
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.
Usage
Installing an artifact with a custom POM
The Maven Install Plugin can include a pre-built custom POM with the artifact in the local repository. Just set the value of the pomFile parameter to the path of the custom POM.
mvn install:install-file -Dfile=path-to-your-artifact-jar -DpomFile=path-to-pom
BASH
Installing an artifact to a specific local repository path
By default, Maven Install Plugin uses the local repository defined in the settings.xml to install an artifact.
You could install an artifact on a specific local repository by setting the localRepositoryPath parameter when installing.
mvn install:install-file -Dfile=path-to-your-artifact-jar \
-DgroupId=your.groupId \
-DartifactId=your-artifactId \
-Dversion=version \
-Dpackaging=jar \
-DlocalRepositoryPath=path-to-specific-local-repo
BASH
See Also
Ref