在运行 mvn test 出错

错误提示:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project ssm-demo: There are t
est failures.
[ERROR]
[ERROR] Please refer to C:UserslxIdeaProjectsssmdemotargetsurefire-reports for the individual test results.

项目目录
图片描述

test

package model;
import org.junit.*;
import org.junit.Assert.*;
public class HelloWorldTest {
    @Test
    public  void  sayHi(){
       Assert.assertEquals("Hello world!",new HelloWorld().sayHi());
    }

}
阅读 4.9k
1 个回答

原来还是maven 得配置问题:
在 pom.xml <project>标签下添加
<build>

    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <testFailureIgnore>true</testFailureIgnore>
            </configuration>
        </plugin>
    </plugins>
</build>

原文链接:

https://blog.csdn.net/gwd1154...

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题