场景

方便本地进行项目依赖组件的版本安全扫描

方案

使用dependency-check-maven组件进行工程扫描,在pom中增加dependency-check-maven依赖和插件命令

    <dependencies>
        ....
        <dependency>
            <groupId>org.owasp</groupId>
            <artifactId>dependency-check-maven</artifactId>
            <version>6.4.1</version>
            <type>maven-plugin</type>
        </dependency>

    </dependencies>
    <build>
        <plugins>
           ....
            <plugin>
                <groupId>org.owasp</groupId>
                <artifactId>dependency-check-maven</artifactId>
                <version>6.4.1</version>
                <configuration>
                    <autoUpdate>true</autoUpdate>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

操作

使用dependency-check:check开启检查

问题

缺少.NET 环境

  • 使用dotnet命令查看是否安装.NET 环境
>dotnet
-bash: dotnet: command not found

执行报错

无法访问github所致。

Logo

一站式 AI 云服务平台

更多推荐