How does maven install local jars to local repositories

1. First confirm whether your maven has been configured:

2. Local jar package location:

3. Install the local jar to the local repository:


Order:

mvn install:install-file -Dfile=D:/taobao-sdk-java-auto-20160607.jar -DgroupId=com.ganshane.specs -DartifactId=taobao-sdk-java-auto-20160607 -Dversion=1.0.0 -Dpackaging=jar

mvn install:install-file -Dfile=D:/taobao-sdk-java-auto-20160607-source.jar -DgroupId=com.ganshane.specs -DartifactId=taobao-sdk-java-auto-20160607-source -Dversion=1.0.0 -Dpackaging=jar

4. Go to the local warehouse to check whether the installation is successful: the following screenshot indicates that the installation is successful



5. Finally add the jar dependency in your own project:

6. Check whether the addition is successful in maven:




Remark:

1. The artifactId of the custom jar cannot be the same, but the groupId can be the same

2. Pay attention to the spaces in the above command, and be sure to check whether the control has executed the build success, otherwise the addition will fail.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324851751&siteId=291194637