上传本地jar包到Nexus

2019-07-18

一些第三方提供的SDK,往往在Maven中央仓库是下载不到的,这个时候如果搭建了私服,就可以往上面丢

相关命令如下:

mvn deploy:deploy-file -DgroupId=org.budo -DartifactId=mipush_sdk_server -Dversion=2_2_21 -Dpackaging=jar -Dfile=MiPush_SDK_Server_2_2_21.jar -Durl=http://nexus-server:8081/nexus/content/repositories/thirdparty/ -DrepositoryId=snapshots.nexus.ewei.ren

settings.xml 关键配置如下:

<servers>
   <server>
      <id>snapshots.nexus.ewei.ren</id>
      <username>deployment</username>
      <password>12369.</password>
   </server>
</servers>

<mirrors>
   <mirror>
      <id>snapshots.nexus.ewei.ren</id>
      <name>nexus-ewei</name>
      <url>http://nexus-server:8081/nexus/content/groups/public</url>
      <mirrorOf>*</mirrorOf>
   </mirror>
</mirrors>