mvn deploy命令上传包

配置settings.xml

因为nexus是需要登陆操作,当然可以通过配置免登陆

<server>   
<id>Snapshots</id>   
<username>admin</username>
<password>admin123</password>   
</server>

有源码的情况,mvn:deploy 可以直接将代码发布到仓库

cmd输入命令

mvn deploy:deploy-file -DgroupId=com.xx.yy.log -DartifactId=xx-log-client -Dversion=4.0-SNAPSHOT -Dpackaging=jar -Dfile=E:\xx-log-client-4.0-SNAPSHOT.jar -Durl=http://127.0.0.1:8080/nexus/content/repositories/snapshots/ -DrepositoryId=Snapshots

DgroupId和DartifactId构成了该jar包在pom.xml的坐标
Dfile表示需要上传的jar包的绝对路径。
Durl私服上仓库的位置,打开nexus——>repositories菜单,可以看到该路径。
DrepositoryId服务器的表示id,在nexus的configuration可以看到。
Dversion表示版本信息

上传成功后,在nexus界面点击 -DrepositoryId=Snapshots 对应的仓库可以看到这包。

你可能感兴趣的:(源码,nexus,发布,库,mvn-deploy)