这篇文章主要讲解了“maven项目的依赖树怎么生成”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“maven项目的依赖树怎么生成”吧!
1、mvn 依赖:树
该命令生成maven项目的依赖树。
$ mvn dependency:tree ... [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ Mockito-Examples --- [INFO] com.journaldev.mockito:Mockito-Examples:jar:1.0-SNAPSHOT [INFO] +- org.junit.platform:junit-platform-runner:jar:1.2.0:test [INFO] | +- org.apiguardian:apiguardian-api:jar:1.0.0:test [INFO] | +- org.junit.platform:junit-platform-launcher:jar:1.2.0:test [INFO] | \- org.junit.platform:junit-platform-suite-api:jar:1.2.0:test [INFO] | \- org.junit.platform:junit-platform-commons:jar:1.2.0:test [INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.2.0:test [INFO] | +- org.junit.platform:junit-platform-engine:jar:1.2.0:test [INFO] | | \- org.opentest4j:opentest4j:jar:1.1.0:test [INFO] | \- org.junit.jupiter:junit-jupiter-api:jar:5.2.0:test [INFO] +- org.mockito:mockito-junit-jupiter:jar:2.19.0:test [INFO] | \- org.mockito:mockito-core:jar:2.19.0:test [INFO] | +- net.bytebuddy:byte-buddy:jar:1.8.10:test [INFO] | +- net.bytebuddy:byte-buddy-agent:jar:1.8.10:test [INFO] | \- org.objenesis:objenesis:jar:2.6:test [INFO] \- org.testng:testng:jar:6.14.3:test [INFO] +- com.beust:jcommander:jar:1.72:test [INFO] \- org.apache-extras.beanshell:bsh:jar:2.0b6:test
2、mvn 依赖:分析
此命令分析 maven 项目以识别未使用的已声明和已使用的未声明依赖项。通过识别未使用的依赖项,然后将其从 pom.xml 文件中删除,这有助于减少构建大小。
$ mvn dependency:analyze... [INFO] --- maven-dependency-plugin:2.8:analyze (default-cli) @ Mockito-Examples ---[WARNING] Used undeclared dependencies found: [WARNING] org.junit.jupiter:junit-jupiter-api:jar:5.2.0:test[WARNING] org.mockito:mockito-core:jar:2.19.0:test[WARNING] Unused declared dependencies found: [WARNING] org.junit.platform:junit-platform-runner:jar:1.2.0:test[WARNING] org.junit.jupiter:junit-jupiter-engine:jar:5.2.0:test[WARNING] org.mockito:mockito-junit-jupiter:jar:2.19.0:test... $
感谢各位的阅读,以上就是“maven项目的依赖树怎么生成”的内容了,经过本文的学习后,相信大家对maven项目的依赖树怎么生成这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。