2 回答
TA贡献1793条经验 获得超6个赞
如果您有权访问 maven 存储库(在执行此命令时)并安装了 mvn/mvnw ,则可以从命令行执行此行。
mvn org.owasp:dependency-check-maven:5.2.2:check
“dependency-check-report.html”报告将在目标文件夹中生成。
TA贡献1785条经验 获得超8个赞
出于兴趣,我尝试了它,对我来说它正在工作:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-email</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>3.3.3</version>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
依赖检查 Maven 告诉我:
[INFO] Analysis Complete (1 seconds)
[WARNING]
One or more dependencies were identified with known vulnerabilities in test:
commons-email-1.1.jar (org.apache.commons:commons-email:1.1, cpe:/a:apache:commons_email:1.1) : CVE-2017-9801, CVE-2018-1294
See the dependency-check report for more details.
您的依赖项部分看起来如何?例如,如果您为 commons-email 定义范围测试,则不会显示警告
添加回答
举报