1.假如有一个jar包 wolong-api-sdk-v1.2.jar 在如图的位置,现在需要导入本地的maven仓库;
2.打开dos命令窗口输入一下命令即可完成导入;
mvn install:install-file -Dfile=C:\Users\LJH\Desktop\linshi\wolong-api-sdk-v1.2.jar
-DgroupId=com.ceshi
-DartifactId=wolong-api
-Dversion=1.0.0 -Dpackaging=jar
命令注释:
mvn install:install-file
-Dfile=jar包的位置
-DgroupId=在本地仓库的地址,自定义
-DartifactId=在pom.xml中导入时的名字,自定义
-Dversion=版本号,自定义
-Dpackaging=jar
注意事项:
1.maven的 settings.xml文件是否有配置本地仓库地址
<localRepository>F:\maven\apache-maven-3.6.1-bin\repository</localRepository>
2.idea中maven本地仓库地址是否一致;