Maven报“transitive dependencies (if any) will not be available”问题
Dependencies
A rewrite of the old legacy software "depends.exe" in C# for Windows devs to troubleshoot dll load dependencies issues.
项目地址:https://gitcode.com/gh_mirrors/de/Dependencies
免费下载资源
·
问题现象
使用Maven在构建模块A时报错:
[WARNING] The POM for x-y-z:1.0.0-SNAPSHOT is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
问题排查
重新构建,通过-X参数打开调试查看详细日志。
mvn clean compile -U -X
此时日志里在刚才的报错下面,会多一条日志:
[ERROR] ‘dependencies.dependency.version’ for xxx:x-y-z:jar is missing
经过进一步排查发现,xxx:x-y-z:jar是本模块A所依赖的另一个模块B的pom中,存在未指定版本的依赖项。
之所以B模块在构建时没有出错,是因为B模块的parent pom(记为C)使用dependencyManagement定义了x-y-z的version,但是在deploy B时没有deploy其parent pom,导致在其他机器上构建A模块时,无法拉取到最新的parent pom C,从而导致version missing问题。
解决方案
Deploy parent-pom C,使用
mvn clean deploy -N
在deploy任何模块时,一定要同时要保证其parent已经deploy为最新版本,建议使用
mvn clean deploy -am -pl some-module
GitHub 加速计划 / de / Dependencies
8.6 K
704
下载
A rewrite of the old legacy software "depends.exe" in C# for Windows devs to troubleshoot dll load dependencies issues.
最近提交(Master分支:1 个月前 )
1997a400 - 2 年前
2f423539 - 2 年前
更多推荐
已为社区贡献1条内容
所有评论(0)