Below is how to do it
mvn install:install-file
-Dfile=<path-to-file>
-DgroupId=<group-id>
-DartifactId=<artifact-id>
-Dversion=<version>
-Dpackaging=<packaging>
-DgeneratePom=true
Where: <path-to-file> the path to the file to load
<group-id> the group that the file should be registered under
<artifact-id> the artifact name for the file
<version> the version of the file
<packaging> the packaging of the file e.g. jar
For example, I want to add simplejpa to my maven local repository, here’s the command I issued:
mvn install:install-file -Dfile=~/Programming/api/simplejpa-1.5.jar -DgroupId=com.spaceprogram -DartifactId=simplejpa -Dversion=1.5 -Dpackaging=jar -DgeneratePom=true
This will add the simplejpa jar into the local Maven2 repository under groupId com.spaceprogram and artifactId simplejpa. pom.xml file needs to be edited to add this dependency.
Reference links: http://maven.apache.org/general.html#importing-jars http://jeff.langcode.com/archives/27