首页 /  技术专区  /  Maven 宽屏模式 >

Maven打包Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2报错

Maven打包Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2报错,是因为项目中添加测试类的问题。


解决办法:

pom文件中添加配置跳过测试。

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
        <!--添加配置跳过测试-->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.22.1</version>
            <configuration>
                <skipTests>true</skipTests>
            </configuration>
        </plugin>
        <!--添加配置跳过测试-->
    </plugins>
</build>

image.png


头像
0/200
图片验证码