maven 多模块项目,自己在本地搭建的私服,然后在 API 模块里调用 service 时出错,提示 missing,如下图 [图片] service 模块与 dao 模块本来应该是加载本地对应的文件夹的,不知道为什么会去在仓库中寻找 jar 包,有经验的麻烦帮忙看下问题 :)

Maven 多模块项目加载 jar 包时 missing 的问题求解

本贴最后更新于 678 天前,其中的信息可能已经物是人非

maven 多模块项目,自己在本地搭建的私服,然后在 API 模块里调用 service 时出错,提示 missing,如下图

TIM20180419090937png

service 模块与 dao 模块本来应该是加载本地对应的文件夹的,不知道为什么会去在仓库中寻找 jar 包,有经验的麻烦帮忙看下问题 :)

  • Maven

    Maven 是基于项目对象模型(POM)、通过一小段描述信息来管理项目的构建、报告和文档的软件项目管理工具。

    159 引用 • 316 回帖 • 644 关注
  • Q&A

    提问之前请先看《提问的智慧》,好的问题比好的答案更有价值。

    1513 引用 • 9965 回帖 • 573 关注
  • jar
    23 引用 • 120 回帖
12 回帖
请输入回帖内容...
  • 88250

    贴下 pom.xml

    2 回复
  • alanfans

    maven 本来就是找的本地仓库的 jar,你没把模块安装在本地仓库。贴 pom 吧

  • someone11069

    @88250

    API
    apipng

    service

    servicepng

  • someone11069

    @88250 只有 API 模块与 service 模块报错,在仓库中是找不到 jar 包的

    应该是如下图 dao 模块这样的,引入的是本地项目对应的文件夹

    daopng

  • 88250

    执行 mvn install 的日志贴一下

  • 88250

    用 ``` 包裹,不要贴图。

    2 回复
  • someone11069
    [INFO]
    [INFO] ------------------------------------------------------------------------
    [INFO] Building jingjing-school-service 0.0.1-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO]
    [INFO] jingjing-school .................................... SUCCESS [  0.531 s]
    [INFO] jingjing-school-entity ............................. SUCCESS [  1.932 s]
    [INFO] jingjing-school-dao ................................ SUCCESS [  0.320 s]
    [INFO] jingjing-school-service ............................ FAILURE [  0.166 s]
    [INFO] jingjing-school-api ................................ SKIPPED
    [INFO] jingjing school client ............................. SKIPPED
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 3.609 s
    [INFO] Finished at: 2018-04-19T09:31:13+08:00
    [INFO] Final Memory: 36M/434M
    [INFO] ------------------------------------------------------------------------
    
  • someone11069
    [ERROR] Failed to execute goal on project jingjing-school-service: Could not resolve dependencies for project com.hy.jingjing:jingjing-schoo
    l-service:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at com.hy.jingjing:jingjing-auth-client:jar:0.0.1-SNAPSHOT: Failed to read arti
    fact descriptor for com.hy.jingjing:jingjing-auth-client:jar:0.0.1-SNAPSHOT: Failure to find com.hy.jingjing:jingjing-auth:pom:0.0.1-SNAPSHO
    T in http://192.168.0.249:8082/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the
    update interval of nexus-mirror has elapsed or updates are forced -> [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/DependencyResolutionException
    [ERROR]
    [ERROR] After correcting the problems, you can resume the build with the command
    [ERROR]   mvn <goals> -rf :jingjing-school-service
    
    1 回复
  • 88250

    你这个 auth-client 没有嘛,导致 service 编译不出来。

    1 回复
  • someone11069

    谢谢 D 大,已解决

    1 回复
  • 88250

    老铁,以后仔细看日志啊..

    1 回复
  • someone11069

    昨天领导都试过了,我就把他做的给忽略掉了,下次注意😂

请输入回帖内容 ...