eclipse打包springboot程序提示程序包junit.framework不存在怎么解决

[ERROR] /C:/Users/Administrator/Desktop/.workspace/boot-01-helloworld/src/test/java/com/atguigu/boot_01_helloworld/AppTest.java:[3,23] 程序包junit.framework不存在
[ERROR] /C:/Users/Administrator/Desktop/.workspace/boot-01-helloworld/src/test/java/com/atguigu/boot_01_helloworld/AppTest.java:[4,23] 程序包junit.framework不存在
[ERROR] /C:/Users/Administrator/Desktop/.workspace/boot-01-helloworld/src/test/java/com/atguigu/boot_01_helloworld/AppTest.java:[5,23] 程序包junit.framework不存在
[ERROR] /C:/Users/Administrator/Desktop/.workspace/boot-01-helloworld/src/test/java/com/atguigu/boot_01_helloworld/AppTest.java:[11,13] 找不到符号
符号: 类 TestCase
[ERROR] /C:/Users/Administrator/Desktop/.workspace/boot-01-helloworld/src/test/java/com/atguigu/boot_01_helloworld/AppTest.java:[26,19] 找不到符号
符号: 类 Test
位置: 类 com.atguigu.boot_01_helloworld.AppTest
[ERROR] /C:/Users/Administrator/Desktop/.workspace/boot-01-helloworld/src/test/java/com/atguigu/boot_01_helloworld/AppTest.java:[28,20] 找不到符号
符号: 类 TestSuite
位置: 类 com.atguigu.boot_01_helloworld.AppTest
[ERROR] /C:/Users/Administrator/Desktop/.workspace/boot-01-helloworld/src/test/java/com/atguigu/boot_01_helloworld/AppTest.java:[36,9] 找不到符号
符号: 方法 assertTrue(boolean)
位置: 类 com.atguigu.boot_01_helloworld.AppTest

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) on project boot-01-helloworld: Compilation failure: Compilation failure:
[ERROR] /C:/Users/Administrator/Desktop/.workspace/boot-01-helloworld/src/test/java/com/atguigu/boot_01_helloworld/AppTest.java:[3,23] 程序包junit.framework不存在
[ERROR] /C:/Users/Administrator/Desktop/.workspace/boot-01-helloworld/src/test/java/com/atguigu/boot_01_helloworld/AppTest.java:[4,23] 程序包junit.framework不存在
[ERROR] /C:/Users/Administrator/Desktop/.workspace/boot-01-helloworld/src/test/java/com/atguigu/boot_01_helloworld/AppTest.java:[5,23] 程序包junit.framework不存在
[ERROR] /C:/Users/Administrator/Desktop/.workspace/boot-01-helloworld/src/test/java/com/atguigu/boot_01_helloworld/AppTest.java:[11,13] 找不到符号
[ERROR] 符号: 类 TestCase
[ERROR] /C:/Users/Administrator/Desktop/.workspace/boot-01-helloworld/src/test/java/com/atguigu/boot_01_helloworld/AppTest.java:[26,19] 找不到符号
[ERROR] 符号: 类 Test
[ERROR] 位置: 类 com.atguigu.boot_01_helloworld.AppTest
[ERROR] /C:/Users/Administrator/Desktop/.workspace/boot-01-helloworld/src/test/java/com/atguigu/boot_01_helloworld/AppTest.java:[28,20] 找不到符号
[ERROR] 符号: 类 TestSuite
[ERROR] 位置: 类 com.atguigu.boot_01_helloworld.AppTest
[ERROR] /C:/Users/Administrator/Desktop/.workspace/boot-01-helloworld/src/test/java/com/atguigu/boot_01_helloworld/AppTest.java:[36,9] 找不到符号
[ERROR] 符号: 方法 assertTrue(boolean)
[ERROR] 位置: 类 com.atguigu.boot_01_helloworld.AppTest
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

依赖问题,清理一下重新下载。

这个简单,除了进行进行常规的maven依赖清理,然后重新下载之外,你需要设置禁止test的打包,你这个springboot程序项目根本就没必要打包单元测试吧?你上面的报错好多都是单元测试那块报的错误

img

img

eclipse应该也有这个功能,或者你在pom.xml加上跳过打包单元测试

img