轉:https://www.jianshu.com/p/b8ec688c388e服務器
打包時提示私服中找不到如下jar包url
在私服中搜索確實找不到,後來知道這些是老系統的jar包沒有deploy到私服spa
經分析詢問得知這些jar的放置路徑以下圖:code
因此,找到settings.xml文件添加以下配置,一會執行命令要用到server
<server> <id>releases</id> <username>admin</username> <password>*****</password> </server>
id
:待會輸入命令的時候須要用到username
:表示Nexus服務器的登錄帳號password
:表示Nexus服務器的登錄密碼xml
上傳命令:blog
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
DgroupId、DartifactId、Dversion
:構成了該jar包在pom.xml的座標,本身起名字也是能夠的.
Dpackaging
:表示打包類型.
Dfile
:表示須要上傳的jar包的絕對路徑.
Durl
:私服上第三方倉庫的地址,打開nexus——>repositories菜單,能夠看到該路徑。
DrepositoryId
:服務器的表示id,就是咱們在setting.xml文件中配置的serverId
搜索一下:已經有了,說明上傳成功了!get