Maven 私庫 ,Deploy
因爲網絡原因,能夠從公共倉庫下載jar文件,但無法通過 maven 自動引入。
方式一 ,命令方式
1)命令
mvn deploy:deploy-file -Dfile="jar文件磁盤路徑" -DgroupId=org.hasp -DartifactId=hasp-srm-api -Dversion=1.0.0 -Durl=http://172.16.10.41/repository/maven-releases/ -Dpackaging=jar -DrepositoryId=deploymentRepo
2)參數說明
-Dfile:jar文件路徑
-DgroupId:groupId
-DartifactId:artifactId
-Dversion:version
-Durl:要提交到私庫的url
-Dpackaging:jar
-DrepositoryId:倉庫id號,就是settings.xml中給私庫設置的id號
3)倉庫ID
maven, setting.xml 配置文件裏有。
私庫配置
<mirror>
<id>deploymentRepo</id>
<name>aaa</name>
<url>http://172.16.10.41/repository/maven-public/</url>
<mirrorOf>*</mirrorOf>
</mirror>
私庫訪問權限
<server>
<id>deploymentRepo</id>
<username>admin</username>
<password>123456</password>
</server>
參考:
https://blog.csdn.net/fuck487/article/details/73920886