在mvn clean install时禁用org.owasp dependency-check-maven,但在mvn clean site期间启用

oo7oh9g9  于 2024-01-06  发布在  Maven
关注(0)|答案(1)|浏览(174)

我想避免在运行mvn clean install时运行org.owasp dependency-check-maven。另一方面,我希望它在mvn clean site上运行。
在我的pom文件中,我有这样的代码:

<plugin>
    <groupId>org.owasp</groupId>
    <artifactId>dependency-check-maven</artifactId>
    <version>8.4.2</version>
    <configuration>
        <assemblyAnalyzerEnabled>false</assemblyAnalyzerEnabled>
        <formats>
            <format>html</format>
        </formats>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>check</goal>
            </goals>
        </execution>
    </executions>
</plugin>

字符串
但是,到目前为止,在mvn clean install期间运行了整个依赖项检查:

[INFO] --- dependency-check:8.4.2:check (default) @ project ---
[INFO] Checking for updates
[INFO] Skipping NVD check since last check was within 4 hours.
[INFO] Skipping RetireJS update since last update was within 24 hours.
[INFO] Skipping Hosted Suppressions file update since last update was within 2 hours.
[INFO] Skipping Known Exploited Vulnerabilities update check since last check was within 24 hours.
[INFO] Check for updates complete (18 ms)


这是冗长的,并且仅在需要整个站点时才需要。
如何只对mvn site而不是mvn clean install运行依赖项检查?

相关问题