赞
踩
dependency-check官网下载地址: https://owasp.org/www-project-dependency-check
这个工具支持多种方式,本文主要介绍使用maven插件的使用方式和命令行方式
在maven的pom.xml的插件配置中添加如下配置内容:
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>${dependency-check-maven.version}</version>
<configuration>
<autoUpdate>false</autoUpdate>
<dataDirectory>D:\ProgramFiles\dependency-check\data</dataDirectory>
<versionCheckEnabled>false</versionCheckEnabled>
<retireJsForceUpdate>false</retireJsForceUpdate>
<ossindexAnalyzerUseCache>true</ossindexAnalyzerUseCache>
<skipRuntimeScope>true</skipRuntimeScope>
<skipProvidedScope>true</skipProvidedScope>
<skipSystemScope>true</skipSystemScope>
<skipTestScope>true</skipTestScope>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
以上配置了插件常用的一些参数,如果需要查看更多参数,可以使用如下命令查看:
mvn help:describe -Dcmd=dependency-check:check -Ddetail
autoUpdate
dataDirectory
这是存放CVE漏洞数据的目录,如果autoUpdate为true,也会在这个目录下更新
mvn dependency-check:check
会在target目录下生成一个dependency-check-report.html
mvn dependency-check:aggregate
会在父工程的target目录下生成一个dependency-check-report.html
dependency-check.bat --cveUrlModified "file:///D:/ProgramFiles/dependency-check/data/nvdcache/nvdcve-1.1-modified.json.gz" --cveUrlBase "file:///D:/ProgramFiles/dependency-check/data/nvdcache/nvdcve-1.1-modified.json.gz" --disableRetireJS --disableNodeJS --project "demo-project" -s "G:/workspaces/projects/demo-project/target/unification-api/WEB-INF/lib" -o "G:/workspaces/projects/demo-project/target"
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。