Edit this Page

Install a jar file to maven repository

Sometimes your maven project depends on java libraries that do not have an associated maven artifact. Such a jar file can be installed to maven manually:

mvn install:install-file -Dfile=<PATH TO JAR> -DgroupId=<GROUP ID> -DartifactId=<ARTEIFACT ID> -Dversion=<VERSION> -Dpackaging=jar

Here the <PATH TO JAR> is a path to the jar library. The <GROUP ID>, <ARTEIFACT ID>, and <VERSION> can have arbitrary values, they just have to correspond with the values specified in the pom dependency.

For PowerShell: in PowerShell, program parameters starting with minus and containing dot need to be quoted, for example: '-DgroupId=com.example.app' instead of -DgroupId=com.example.app