关于Maven无法上传快照SNAPSHOT包,You cannot upload a snapshot version into a release repository的解决
2017-09-11 17:24
549 查看
我们这里只讲一下利用Nexus搭建的Maven私服处理办法。
通常上传自己的jar包,是通过3rd party中Artifact Upload就可以完成,新建一个hosted也是有Artifact Upload可以上传jar包。
但新建一个snapshot-hosted 却没有Artifact Upload可以上传jar包。
而release库里又没法上传SNAPSHOT包,所以这里介绍一下通过maven命令来上传的方法。
一、需要修改maven安装目录下conf里settings.xml
<!-- 配置远程仓库验证信息 -->
<servers>
<server>
<id>xxxx</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>xxxx-snapshot</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<!-- 配置远程发布到私服,mvn deploy-->
<distributionManagement>
<repository>
<id>xxxx</id>
<name>xxxx</name>
<url>http://192.168.xx.xx/content/repositories/xxxx/</url>
</repository>
<snapshotRepository>
<id>xxxx-snapshot</id>
<name>xxxx-snapshot</name>
<url>http://192.168.xx.xx/content/repositories/xxxx-snapshot/</url>
</snapshotRepository>
</distributionManagement>
二、maven的执行命令
mvn deploy:deploy-file
-DgroupId=com.xxx
-DartifactId=xxx-core
-Dversion=1.8.0-SNAPSHOT
-Dpackaging=jar
-Dfile=D:/xxx-core-1.8.0-SNAPSHOT.jar
-Durl=http://192.168.xx.xx/content/repositories/xxxx-snapshot/
-DrepositoryId=xxxx-snapshot
Dfile表示需要上传的jar包的绝对路径。
Durl私服上仓库的位置,打开nexus——>repositories菜单,可以看到该路径。
DrepositoryId服务器的表示id,在nexus的configuration可以看到。
执行命令,如果上传成功则显示
不成功也会有相应的提示,如返回401是验证失败之类的,要具体来看。
以上,完成了jar包的上传。
通常上传自己的jar包,是通过3rd party中Artifact Upload就可以完成,新建一个hosted也是有Artifact Upload可以上传jar包。
但新建一个snapshot-hosted 却没有Artifact Upload可以上传jar包。
而release库里又没法上传SNAPSHOT包,所以这里介绍一下通过maven命令来上传的方法。
一、需要修改maven安装目录下conf里settings.xml
<!-- 配置远程仓库验证信息 -->
<servers>
<server>
<id>xxxx</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>xxxx-snapshot</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<!-- 配置远程发布到私服,mvn deploy-->
<distributionManagement>
<repository>
<id>xxxx</id>
<name>xxxx</name>
<url>http://192.168.xx.xx/content/repositories/xxxx/</url>
</repository>
<snapshotRepository>
<id>xxxx-snapshot</id>
<name>xxxx-snapshot</name>
<url>http://192.168.xx.xx/content/repositories/xxxx-snapshot/</url>
</snapshotRepository>
</distributionManagement>
二、maven的执行命令
mvn deploy:deploy-file
-DgroupId=com.xxx
-DartifactId=xxx-core
-Dversion=1.8.0-SNAPSHOT
-Dpackaging=jar
-Dfile=D:/xxx-core-1.8.0-SNAPSHOT.jar
-Durl=http://192.168.xx.xx/content/repositories/xxxx-snapshot/
-DrepositoryId=xxxx-snapshot
Dfile表示需要上传的jar包的绝对路径。
Durl私服上仓库的位置,打开nexus——>repositories菜单,可以看到该路径。
DrepositoryId服务器的表示id,在nexus的configuration可以看到。
执行命令,如果上传成功则显示
不成功也会有相应的提示,如返回401是验证失败之类的,要具体来看。
以上,完成了jar包的上传。
相关文章推荐
- 关于maven版本管理 SNAPSHOT RELEASE(version)
- 关于ajaxFileUpload只能上传一次的解决
- Maven项目中,关于Spring Boot 整合MyBatis时,Service层无法找到mapper接口的问题解决
- 关于github在客户端不小心删除新仓库,重建后无法上传解决方法
- 关于上传视频节目不转码、无法预览的解决方法
- Jquery uploadify图片上传插件,无法上传的解决方法
- 关于Cannot construct org.apache.maven.plugin.war.util.WebappStructure maven打包问题解决
- 关于“服务器限制无法上传那么大的附件 ”的解决方法
- 关于ajaxFileUpload只能上传一次的解决
- 关于Qt生成Debug和Release应用程序无法运行的解决办法
- 关于JFinal的单个input标签type=file的multiple="multiple"多图片上传,每次只接收到一个uploadFile对象的解决办法。
- jQuery 关于IE9上传文件无法进入后台问题的原因及解决办法
- You cannot run the non-logged version of bulk copy in this database. Please check with the DBO. 问题的解决方法
- Maven部署异常:on project standalone-pom: Cannot deploy artifact from the local repository解决方法
- 关于AfterLogic WebMail 的.net版无法上传控件的解决办法
- Maven下解决Cannot change version of project facet Dynamic Web module to 3.0
- 已解决:无法连接到WMI提供程序。你没有权限或者该服务器无法访问/cannot connect to WMI provider. You do not have permission or the……
- 关于“Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item.”问题的解决
- 关于uploadifive 文件上传时出现406错误解决办法
- 解决Maven项目中的错误:Cannot change version of project