mvn install:install-file -Dfile=PathOFJar_MyJar-x.x.x.jar -DgroupId=com.mycompany -DartifactId=myJar -Dversion=x.x.x -Dpackaging=jar
After installing, Add the dependency into Pom.xml :
<dependency> <groupId>com.mycompany</groupId> <artifactId>myJar</artifactId> <version>x.x.x</version> </dependency>
As an alternative, you can directly refer to a jar file in your file system. This eliminates the hassle that every team member and build server to run the mvn:install command every time someone adds some local jar in pom.xml.
Take a look at following blog post for the details.