本地代码包deploy到内网仓库报错,Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy

今天下午遇到个使用maven的deploy插件推送内网仓库依赖包问题,如下:
在这里插入图片描述
英文不好的看见full stack ,第一眼以为是栈满了,仔细看,关键报错是这句:
Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project xxx: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

查了查相关文档(就是不停百度。。。)
给出结论为:
deploy2.7版本和2.8版本有差异,我们在用2.7版本是,项目中指定了内网仓库路径,可能会和setting.xml发生冲突(其实推送时会报错,但是测试过程中发现,其他项目已经能引入最新包的代码,这种属实是偶然现象,我也没找到具体原因,先说解决办法吧。)

在这里插入图片描述
2.8 版本会使用 setting.xml 中的配置
在这里插入图片描述
解决办法:
注释掉项目中引入内网仓库地址,修改deploy插件版本号为2.8
在这里插入图片描述

		<plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-deploy-plugin</artifactId>
             <version>2.8.2</version>
             <configuration>
                 <skip>true</skip>
             </configuration>
       </plugin>

测试结果:
在这里插入图片描述

  • 5
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
"Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project" 是一个 Maven 构建工具的错误信息,它表示在执行 Maven 构建过程中出现了问题。具体来说,这个错误信息表明在执行 deploy 目标时出现了问题。 Maven 是一个用于构建和管理 Java 项目的工具,它使用基于项目对象模型(Project Object Model,POM)的概念来管理项目的依赖关系、构建过程和部署等任务。 在 Maven 的构建过程中,deploy 目标用于将构建好的项目部署到远程仓库中,以供其他项目或者团队使用。然而,当出现 "Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project" 错误时,通常是由于以下原因之一: 1. 无法连接到远程仓库:可能是由于网络问题或者仓库配置错误导致 Maven 无法连接到指定的远程仓库。 2. 权限问题:可能是由于没有足够的权限将构建好的项目部署到远程仓库。 3. 依赖关系错误:可能是由于项目的依赖关系配置错误导致 Maven 在部署过程中无法解析依赖项。 为了解决这个问题,你可以尝试以下几个步骤: 1. 检查网络连接:确保你的网络连接正常,并且可以访问远程仓库。 2. 检查仓库配置:检查你的 Maven 配置文件(settings.xml)中的仓库配置是否正确,并且你有足够的权限进行部署操作。 3. 检查依赖关系:检查项目的依赖关系配置是否正确,并且所有的依赖项都能够正确解析。 如果以上步骤都没有解决问题,你可以尝试搜索具体的错误信息或者提供更多的错误日志信息,以便更好地定位和解决问题。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值