一、首先配置環境變量
在path 中添加 maven的bin 的路徑 例如:D:\soft\apache-maven-3.2.5\bin;
打開cmd ,執行 mvn -v 檢視maven的環境變量是否配置正确
二、下載下傳你要添加的jar包 ,找到jar包的位置
三、在cmd 中定位到 jar所在的位置
四、輸入 mvn install:install-file -DgroupId=XXX.XXX.XX-DartifactId=XXX-XX -Dversion=1.0.3 -Dpackaging=jar -Dfile=XXX-1.0.3.jar
-DgroupId:表示jar對應的groupId
-DartifactId: 表示jar對應的artifactId
-Dversion: 表示jar對應的 version
-Dfile: 辨別jar包的名稱
五、安裝成功提示
六、引用
<dependency>
<groupId>com.microservice</groupId>
<artifactId>payment-ws-service-remote-api</artifactId>
<version>1.0.3</version>
</dependency>