即使已经在其父项的pom文件的依赖项管理部分中声明了依赖项,也缺少dependencies.dependency.version [英] dependencies.dependency.version is missing even though the dependency is already declared in its parent's pom file's dependency management section

查看:94
本文介绍了即使已经在其父项的pom文件的依赖项管理部分中声明了依赖项,也缺少dependencies.dependency.version的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如上所述,我项目中的dependency:tree目标抱怨说,其父pom的依赖关系管理部分中已经声明的依赖关系缺少依赖版本.请注意,有问题的依赖关系是一个新的依赖关系,只是在管理部分中添加了.

As described, the dependency:tree goal on my my project complains that the dependency version is missing for a dependency that is already declared in the dependency management section of its parent pom. Please note the dependency in question is a new one and is just added in the management section.

推荐答案

的确,父pom已经在依赖项管理部分中包含了依赖项声明.但这没有被考虑在内.为此,我们应该执行命令将pom文件安装在本地Maven存储库中.

It's true that the parent pom has already included the dependency declaration in the dependency management section. But it's not taken into account. To do so, we should execute the command to install the pom file in the local maven repo.

mvn -f <the absolute path to the parent's pom file> install -N

请注意,当maven解析依赖项时,它始终会查找存储库中已经可用的pom文件.而是不考虑本地文件.

Be aware that when maven resolves dependencies, it always looks for pom files already available in the repo. Instead, local files are not taken into account.

这篇关于即使已经在其父项的pom文件的依赖项管理部分中声明了依赖项,也缺少dependencies.dependency.version的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆