Maven异常:Could not find artifact

转载 http://blog.csdn.net/evan_leung/article/details/50658947

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

[plain] view plain copy
  1. [INFO] Scanning for projects...  
  2. [ERROR] [ERROR] Some problems were encountered while processing the POMs:  
  3. [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  
  4.  @   
  5. [ERROR] The build could not read 1 project -> [Help 1]  
  6. [ERROR]     
  7. [ERROR]   The project com.easybuy:easybuy-manager:0.0.1-SNAPSHOT (D:\Users\10856214\workspace-template\easybuy-manager\pom.xml) has 1 error  
  8. [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]  
  9. [ERROR]   
  10. [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.  
  11. [ERROR] Re-run Maven using the -X switch to enable full debug logging.  
  12. [ERROR]   
  13. [ERROR] For more information about the errors and possible solutions, please read the following articles:  
  14. [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException  
  15. [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException  

注意查看这句:

[plain] view plain copy
  1. 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到本地仓库,否则也会出现以上问题

 

 

 

我的工程下面有若干给子工程

<modules>
        <module>trainorg</module>
        <module>intapi</module>
        <module>httpaccess</module>
        <module>common</module>
        <module>logcommon</module>
        <module>student</module>
        <module>coach</module>
        <module>user</module>
        <!--  <module>datasynch</module>-->
        <module>authcode</module>
        <module>car</module>
        <module>report</module>
        <module>business</module>
        <module>flow</module>
        <module>market</module>
        <module>system</module>
        <module>finance</module>

    </modules>

 

intapi项目依赖于common项目

<dependency>
            <groupId>cn.com.liliyun</groupId>
            <artifactId>common</artifactId>
            <version>0.0.1-SNAPSHOT</version>
            <type>jar</type>
        </dependency>

但是我mvn install 就会报Could not find artifact****的异常,我的common项目明明已经编译通过并且install了,为啥还是找不到common, 这是因为需要父工程打包到本地仓库,我整个大项目一期build install就顺利通过

 

转载于:https://www.cnblogs.com/devilwind/p/8618719.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在多模块打包时报错"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 ``` 希望这些解决方案能够帮助到你!如果问题仍然存在,请提供更详细的错误信息,我将尽力提供更进一步的帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值