轉:https://www.jianshu.com/p/b8ec688c388e
打包時提示私服中找不到以下jar包
在私服中搜索確實找不到,后來知道這些是老系統的jar包沒有deploy到私服
經分析詢問得知這些jar的放置路徑如下圖:
所以,找到settings.xml文件添加如下配置,一會執行命令要用到
<server> <id>releases</id> <username>admin</username> <password>*****</password> </server>
id
:待會輸入命令的時候需要用到username
:表示Nexus服務器的登陸賬號password
:表示Nexus服務器的登陸密碼
上傳命令:
mvn -s "C:\Users\ceshi3\.m2\settings-Automation.xml" deploy:deploy-file -DgroupId=com.yto -DartifactId=logic-rutdownload_share -Dversion=2.0 -Dpackaging=jar -Dfile=C:\Users\ceshi3\.m2\repository\com\yto\logic-rutdownload_share-2.0.jar -Durl=http://10.1.193.100:8081/nexus/content/repositories/releases -DrepositoryId=releases
-s:指定settings.xml文件
DgroupId、DartifactId、Dversion
:構成了該jar包在pom.xml的坐標,自己起名字也是可以的.
Dpackaging
:表示打包類型.
Dfile
:表示需要上傳的jar包的絕對路徑.
Durl
:私服上第三方倉庫的地址,打開nexus——>repositories菜單,可以看到該路徑。
DrepositoryId
:服務器的表示id,就是我們在setting.xml文件中配置的serverId
執行成功如下圖:

搜索一下:已經有了,說明上傳成功了!