概述
在测试环境将api to maven时,总是会报下面的错
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project ts-distribution-biz: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
英文不好,加上对maven了解不是很透彻,花了一上午的时间才解决,distributionManagement标签里没有repository元素导致,这之前我都不知道distributionManagement这个东西。。。下面来介绍下
我在本地开发好之后,需要将项目推到远程,一个公用的远程仓库,这样别人就可以调用你的api。
但maven怎么知道要推到哪个远程仓库呢,distributionManagement就是负责将jar包推到指定的远程仓库。
<distributionManagement>
<repository>
<id>nexus-releases</id>
<name>Nexus Release Repository</name>
<url>http://127.0.0.1:8080/nexus/content/repositories/releases/</url>
或者<url>${repo.internal.snapshots.url}</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://127.0.0.1:8080/nexus/content/repositories/snapshots/</url>
或者<url>${repo.internal.releases.url}</url>
</snapshotRepository>
</distributionManagement>
maven会区分release版本和snapshot版本,远程仓库也会对稳定版和snapshot版进行区分。
其实url在settings.xml文件中配置了,所以直接使用占位符就可以了。
http://blog.csdn.net/ichsonx/article/details/49679161
转载于:https://www.cnblogs.com/kivi170806/p/8193879.html
最后
以上就是幸福帆布鞋为你收集整理的环境配置distributionManagement的全部内容,希望文章能够帮你解决环境配置distributionManagement所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复