查看当前项目的已解析依赖 # 平铺mvn dependency:list# 层级mvn dependency:tree# 依赖分析,Used undeclared dependencies found:项目中使用到了,但是没有声明的依赖;Unused declared dependencies found:未使用到的依赖mvn dependency:analyze Maven的Profile的使用 在pom文件中声明profiles,可以设置默认profile.启动的时候以...
maven-dependency-plugin 通过在编译时生成警告来识别它认为是未使用的依赖项。 [WARNING] Unused declared dependencies found: [WARNING] org.foo:bar-api:jar:1.7.5:compile 在某些情况下,此消息是误报,并且依赖关系是可传递的。 问题:如何在我的 pom.xml 中确定是这种情况? 原文由 vpiTriumph 发布,翻译遵循...
另一部分是 Unused declared dependencies found: 显示声明但是未使用,不能一股脑直接删除(analyze只会分析编译主代码和测试代码需要的依赖), 可能在运行的时候需要这些包 可以用插件来声明白名单: <plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-dependency-plugin</artifactId><version>3.0.0...
此时重新执行一下:dependency:analyze-only命令 [INFO] --- maven-dependency-plugin:3.1.2:analyze-only (default-cli) @ taglib-web ---[WARNING] Unused declared dependencies found:[WARNING] org.zxd:taglib-core:jar:1.0.0:compile[WARNING] org.apache.commons:commons-lang3:jar:3.4:compile[WARNING] o...
detect the unused/undeclared dependencies: mvn dependency:analyze Chapter6:Code Quality Plugins jacoco: 若没有生成测试报告(${basedir}/target/site/jacoco) 请确保maven-surefire-plugin 的 skipTests = true 若遇到如下错误,说明二进制文件被损坏了,如下错误 ...
[WARNING] Unused declared dependencies found: [WARNING] org.zxd:taglib-core:jar:1.0.0:compile [WARNING] org.apache.commons:commons-lang3:jar:3.4:compile [WARNING] org.springframework.boot:spring-boot-starter-web:jar:2.4.0:compile [WARNING] org.springframework.boot:spring-boot-starter-test:jar...
[WARNING]com.google.guava:guava:jar:27.0.1-jre:provided[WARNING]com.fasterxml:classmate:jar:1.4.0:provided[WARNING]io.springfox:springfox-core:jar:2.9.2:provided[WARNING]Unused declared dependencies found:[WARNING]io.springfox:springfox-swagger2:jar:2.9.2:provided[WARNING]junit:junit:jar:4.12:...
OS: MAC maven version: Apache Maven 3.6.1 commit: ecba9cf presto version: 0.220 [INFO] --- maven-dependency-plugin:3.1.1:analyze-only (default) @ presto-accumulo --- [WARNING] Unused declared dependencies found: [WARNING] commons-io:comm...
5、优化依赖 mvn dependency:analyze 使用但未声明的依赖(Used undeclared dependencies),建议显示声明 声明但未使用的依赖(Unused declared dependencies),有可能是运行时使用的
[WARNING] Unused declared dependencies found: [WARNING] org.slf4j:slf4j-jdk14:jar:1.7.25:compile [WARNING] joda-time:joda-time:jar:2.10.5:compile [WARNING] com.facebook.airlift:json:jar:0.194:compile [INFO] --- [INFO] BUILD SUCCESS [INFO] --- 1. 2. 3. 4. 5. 6....