Maven 私库,Deploy , jar文件

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章