ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

mvn 报错 - The POM for <name> is invalid, transitive dependencies (if any) will not be available

2021-04-14 15:32:10  阅读:229  来源: 互联网

标签:available 10 14 MILSessionManager 28 invalid manulife 报错 ERROR


核心:  通过 mvn dependency:tree -X 分析依赖
解决方案:  解决依赖冲突版本

1. MILGpController 编译突然报错

14:10:28 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project MILCWSGpPortlet: Compilation failure: Compilation failure:
14:10:28 [ERROR] /app/jenkins/workspace/HK-CWS/sit/HK_CWS_DV11/work/workspace/CWSWS_WPS8/MILCWSGpPortlet/src/manulife/hk/cws/portlet/empf/controller/MILGpController.java:[33,38] package manulife.common.framework.http does not exist
14:10:28 [ERROR] /app/jenkins/workspace/HK-CWS/sit/HK_CWS_DV11/work/workspace/CWSWS_WPS8/MILCWSGpPortlet/src/manulife/hk/cws/portlet/empf/controller/MILGpController.java:[163,9] cannot find symbol
14:10:28 [ERROR] symbol: class SessionStoreModel
14:10:28 [ERROR] location: class manulife.hk.cws.portlet.empf.controller.MILGpController
14:10:28 [ERROR] /app/jenkins/workspace/HK-CWS/sit/HK_CWS_DV11/work/workspace/CWSWS_WPS8/MILCWSGpPortlet/src/manulife/hk/cws/portlet/empf/controller/MILGpController.java:[163,47] cannot find symbol
14:10:28 [ERROR] symbol: variable SessionStoreModel
14:10:28 [ERROR] location: class manulife.hk.cws.portlet.empf.controller.MILGpController
14:10:28 [ERROR] -> [Help 1]
14:10:28 [ERROR]
14:10:28 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
14:10:28 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
14:10:28 [ERROR]
14:10:28 [ERROR] For more information about the errors and possible solutions, please read the following articles:
14:10:28 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
14:10:28 [ERROR]
14:10:28 [ERROR] After correcting the problems, you can resume the build with the command
14:10:28 [ERROR] mvn <goals> -rf :MILCWSGpPortlet


2.发现一个可疑 WARN:

Downloaded: https://artifactory.ap.manulife.com/artifactory/libs-release/manulife/MILSessionManager/1.0.4-jdk8/MILSessionManager-1.0.4-jdk8.pom (2 KB at 69.3 KB/sec)
11:12:16 [WARNING] The POM for manulife:MILSessionManager:jar:1.0.4-jdk8 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more


3.找寻该依赖

POM.xml 里面没有 MILSessionManager:jar:1.0.4-jdk8 的依赖,应该是间接依赖


4. 分析依赖

通过 mvn dependency:tree -X 分析依赖,发现来自于 MILPortletFramework

5. 发现问题

查看 MILPortletFramework 的依赖,发现依赖于 MILSessionManager:jar:1.0.4-jdk8 版本不一致

        <dependency>
            <groupId>manulife</groupId>
            <artifactId>MILSessionManager</artifactId>
            <version>1.0.1</version>
        </dependency>

再加上查看 WARN,分析是依赖冲突,

 

6. 解决问题

在 MILGpController 加上依赖后,编译问题解决

        <dependency>
            <groupId>manulife</groupId>
            <artifactId>MILSessionManager</artifactId>
            <version>1.0.4-jdk8</version>
        </dependency>

搜寻到的更多猜测:

原因之一是当依赖父 pom 已过时的 Project 时。 如果在未安装/部署父 pom 的情况下进行更新,则会发生这种情况。要查看是否是这种情况,只需使用 mvndependency:tree -X 运行并搜索确切的错误。
它将提到它错过了您知道的在父pom中的东西,而不是您依赖的工件(例如jar版本)中的东西。
另外,由于 WARN 造成了 jar 被 transitive,也是触发这个的原因。

标签:available,10,14,MILSessionManager,28,invalid,manulife,报错,ERROR
来源: https://www.cnblogs.com/hanchang/p/haogaoxing.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有