How to specify the path for local cans in maven

I am using maven2 to create a java project. when I try to build using mvn install I get a compilation error saying that some package xya.abc.aaa does not exist. This package is available in my own bank on the local drive. This jar (say test.jar) was created by me.

How can I tell maven to use this local jar for the package it is looking for, is available on my local drive?

+4
source share
1 answer

You need to install the dependencies in the local repository .

 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 eg jar 
+6
source

Source: https://habr.com/ru/post/1381908/


All Articles