for me there are two ways to do same
**Preferred:**
mvn install:install-file \
-Dfile=<path-to-file> \
-DgroupId=<group-id> \
-DartifactId=<artifact-id> \
-Dversion=<version> \
-Dpackaging=<packaging> \
-DgeneratePom=true
> Where each refers to:
>
> <path-to-file>: the path to the file to load e.g → c:\kaptcha-2.3.jar
>
> <group-id>: the group that the file should be registered under e.g →
> com.google.code
>
> <artifact-id>: the artifact name for the file e.g → kaptcha
>
> <version>: the version of the file e.g → 2.3
>
> <packaging>: the packaging of the file e.g. → jar
**Less Preferred:**
> The reason I don't prefer this is because this binds your pom.xml to
> your local machine path and once you put this pom.xml in the code
> repository, everyone binds to follow the same path, what if another
> person has access to nexus/maven repository
<dependency>
<groupId>com.somepackage</groupId>
<artifactId>artifact-name</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>path to your jar</systemPath>
</dependency>
Install the JAR into your local Maven repository as follows:
mvn install:install-file \
-Dfile=<path-to-file> \
-DgroupId=<group-id> \
-DartifactId=<artifact-id> \
-Dversion=<version> \
-Dpackaging=<packaging> \
-DgeneratePom=true
Where each refers to:
`<path-to-file>`: the path to the file to load e.g → `c:\kaptcha-2.3.jar`
`<group-id>`: the group that the file should be registered under e.g → `com.google.code`
`<artifact-id>`: the artifact name for the file e.g → `kaptcha`
`<version>`: the version of the file e.g → `2.3`
`<packaging>`: the packaging of the file e.g. → `jar`
**Reference**
* Maven FAQ: [I have a jar that I want to put into my local repository. How can I copy it in?][1]
* Maven Install Plugin Usage: [The `install:install-file` goal][2]
[1]: http://maven.apache.org/general.html#importing-jars
[2]: https://maven.apache.org/plugins/maven-install-plugin/usage.html#The_install:install-file_goal