Linux:部署第三方Jar包到Nexus私服

为了方便我们开发,经常会有需求就是将第三方的jar包发布到我们自己的nexus私服上;具体可有两种方式实现:1、通过命令进行上传;2、通过nexus管理端页面操作上传。本文就以这两种方式分别做介绍。

mvn install:install-file -DgroupId=com.xxx-DartifactId=xxx.pdf -Dversion=2.1.1 -Dpackaging=jar -Dfile=xxx-2.1.1.jar

mvn install:install-file "-DgroupId=com.xxx" "-DartifactId=xxx.pdf" "-Dversion=2.1.1" "-Dpackaging=jar" "-Dfile=xxx-2.1.1.jar"

mvn deploy:deploy-file "-DgroupId=com.xxx" "-DartifactId=xxx.pdf" "-Dversion=2.1.1" "-Dpackaging=jar" "-Dfile=xxx-2.1.1.jar" -Durl=http://10.188.0.26:8081/repository/maven-releases/ -DrepositoryId=maven-public

DgroupId、DartifactId、Dversion:构成了该jar包在pom.xml的坐标,自己起名字也是可以的.
Dpackaging:表示打包类型.
Dfile:表示需要上传的jar包的绝对路径.
Durl:私服上第三方仓库的地址,打开nexus——>repositories菜单,可以看到该路径。
DrepositoryId:服务器的表示id,就是我们在setting.xml文件中配置的serverId。

https://blog.csdn.net/weixin_37848710/article/details/125915741

 

posted @ 2023-01-31 10:35  深水是沉默  阅读(120)  评论(0编辑  收藏  举报