问题背景

我的环境:

jdk 8
maven3

如题,我遇到了包的 Warning 导致传递依赖失败了。

[WARNING] The POM for com.apple:emit-rocket:jar:1.0 is invalid, transitive dependencies (if any) will not be available: 2 problems were encountered while building the effective model for com.apple:emit-rocket:1.0

我按照网上大神们的建议,使用了调试的命令行

mvn -X -U clean package

发现它指出,我的依赖没有指定版本号。

也就是说我在父Pom文件中的依赖管理(dependencyManagement)中指定的版本没起作用。

告警类似于:

[ERROR] 'dependencies.dependency.version' for com.apple:my-favorite-dependency:jar is missing. @

解决办法

最终,我在 StackOverflow 上找到了答案,是子模块没有意识到父pom中的依赖管理中的内容更新了,需要手动安装一下父pom文件本身,在父pom的目录下执行:

mvn install -N

然后再正常按照之前的方法打包即可。

GitHub 加速计划 / de / Dependencies
36
1
下载
A rewrite of the old legacy software "depends.exe" in C# for Windows devs to troubleshoot dll load dependencies issues.
最近提交(Master分支:8 天前 )
1997a400 - 3 年前
2f423539 - 3 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐