Maven异常:Could not find artifact

用Maven build("clean tomcat7:run" )  Maven聚合工程时,出现了一下问题:

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.easybuy:easybuy-manager:0.0.1-SNAPSHOT: Could not find artifact com.easybuy:easybuy-parent:pom:0.0.1-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 3, column 11
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.easybuy:easybuy-manager:0.0.1-SNAPSHOT (D:\Users\10856214\workspace-template\easybuy-manager\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.easybuy:easybuy-manager:0.0.1-SNAPSHOT: Could not find artifact com.easybuy:easybuy-parent:pom:0.0.1-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 3, column 11 -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

注意查看这句:

Could not find artifact com.easybuy:easybuy-parent:pom:0.0.1-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 3, column 11 ->

原因是本地仓库缺少了easybuy-parent:pom:0.0.1-SNAPSHOT, 原来是忘记了将父工程打包到本地仓库 ,运行聚合工程前记得先将依赖的工程都先Maven install到本地仓库,否则也会出现以上问题


用Maven install 对父工程安装到本地仓库





  • 70
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 16
    评论
在多模块打包时报错"Error: Could not find artifact 包地址"通常是由于以下几个原因造成的: 1. 仓库配置错误:请确保你的仓库配置文件(如settings.xml)中配置了正确的仓库地址和认证信息。你可以检查一下该文件中的配置是否正确,并尝试重新构建项目。 2. 模块依赖错误:检查一下你的模块依赖是否正确。如果你依赖的模块不存在或者版本号错误,可能会导致无法找到对应的artifact。你可以检查一下依赖项的名称和版本号是否正确,并且确保这些依赖模块可以在仓库中找到。 3. Maven仓库问题:如果你使用的是私有仓库,可能会出现无法找到artifact的问题。请确保你的私有仓库可用,并且在仓库配置中进行正确的设置。 4. 网络连接问题:有时候,网络连接不稳定或者防火墙设置会导致无法下载artifact。请确保你的网络连接正常,并且能够访问相关仓库。 5. 手动安装artifact:如果你确定artifact在仓库中存在,但仍然无法找到,你可以考虑手动安装该artifact到本地仓库。你可以使用以下命令将artifact安装到本地仓库: ``` mvn install:install-file -Dfile=path/to/artifact.jar -DgroupId=group-id -DartifactId=artifact-id -Dversion=version -Dpackaging=jar ``` 希望这些解决方案能够帮助到你!如果问题仍然存在,请提供更详细的错误信息,我将尽力提供更进一步的帮助。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

元学习

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值