javastacks / spring-boot-best-practice

Spring Boot 最佳实践,包括自动配置、核心原理、源码分析、国际化支持、调试、日志集成、热部署等。
https://www.javastack.cn
Apache License 2.0
4.52k stars 1.24k forks source link

compilation error #2

Closed josergc closed 1 year ago

josergc commented 3 years ago

hello! I checkout master branch, compile with mvn install but I get compilation error

...
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ spring-boot-test ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to xxx/projects/spring-boot-best-practice/spring-boot-test/target/test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] xxx/projects/spring-boot-best-practice/spring-boot-test/src/test/java/cn/javastack/springboot/test/JavaTest.java:[3,17] package org.junit does not exist
[ERROR] xxx/projects/spring-boot-best-practice/spring-boot-test/src/test/java/cn/javastack/springboot/test/JavaTest.java:[4,17] package org.junit does not exist
[ERROR] xxx/projects/spring-boot-best-practice/spring-boot-test/src/test/java/cn/javastack/springboot/test/JavaTest.java:[5,24] package org.junit.runner does not exist
[ERROR] xxx/projects/spring-boot-best-practice/spring-boot-test/src/test/java/cn/javastack/springboot/test/JavaTest.java:[16,2] cannot find symbol
  symbol: class RunWith
[ERROR] xxx/projects/spring-boot-best-practice/spring-boot-test/src/test/java/cn/javastack/springboot/test/JavaTest.java:[24,6] cannot find symbol
  symbol:   class Test
  location: class cn.javastack.springboot.test.JavaTest
[ERROR] xxx/projects/spring-boot-best-practice/spring-boot-test/src/test/java/cn/javastack/springboot/test/JavaTest.java:[32,6] cannot find symbol
  symbol:   class Test
  location: class cn.javastack.springboot.test.JavaTest
[INFO] 6 errors 
...
mingcheng commented 3 years ago

try to add Junit dependency