mvn dependency:analyze 如何工作? [英] How does mvn dependency:analyze work?
问题描述
谁能告诉我 mvn dependency:analyze
是如何工作的?mvn dependency:analyze
在我的一个项目中的输出显示
Can someone let me know how does mvn dependency:analyze
work ? An output of mvn dependency:analyze
in one of my project shows
[WARNING] Used undeclared dependencies found:
[WARNING] org.apache.commons:commons-lang3:jar:3.4:compile
[WARNING] com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
...
[WARNING] Unused declared dependencies found:
[WARNING] org.springframework.boot:spring-boot-starter-test:jar:1.5.4.RELEASE:test
[WARNING] org.springframework.restdocs:spring-restdocs-mockmvc:jar:1.1.3.RELEASE:test
[WARNING] ch.qos.logback:logback-classic:jar:1.1.11:compile
有人可以告诉我以下内容吗-
Can some one let me know the following -
使用的未声明的依赖项
表示什么?这是否意味着这不是在pom.xml
dependencies
中声明而是在代码中使用并通过一些传递依赖项包含在内?未使用的声明依赖项
是否只检查pom.xml
中声明的dependencies
,还是也检查传递依赖项?
- What does
Used undeclared dependencies found
denote? Does it mean that this is not declared inpom.xml
dependencies
but getting used in code and is included via some transitive dependencies? - Does
Unused declared dependencies found
check only for thedependencies
declared inpom.xml
or it checks transitive dependencies as well?
Maven 版本 - 3.5.0
Maven Version - 3.5.0
推荐答案
找到的使用的未声明依赖项表示什么?这是否意味着这不是在 pom.xml 依赖项中声明而是在代码中使用并通过一些传递依赖项包含在内?
What does Used undeclared dependencies found denote? Does it mean that this is not declared in pom.xml dependencies but getting used in code and is included via some transitive dependencies?
没错!
找到的未使用声明的依赖项仅检查 pom.xml 中声明的依赖项还是也检查传递依赖项?
Does Unused declared dependencies found check only for the dependencies declared in pom.xml or it checks transitive dependencies as well?
声明的依赖项是在您的 POM 中声明的依赖项.因此,该插件在其检查中不包含传递依赖项.
Declared dependencies are the dependencies that are declared in your POM. So the plugin does not include transitive dependencies in its check.
请注意,该插件默认进行字节码分析,这对于仅与常量或注释一起使用的依赖项存在问题.在某些情况下,这可能会导致错误报告.有关详细信息,请参阅常见问题解答.
Note, that the plugin does a byte-code analysis by default, which is problematic with dependencies that are only used with constants or annotations. This can lead to false reports in some situations. See the FAQ for details.
这篇关于mvn dependency:analyze 如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!