Maven 빌드 중 아래 오류가 발생함.
[DEBUG] incrementalBuildHelper#beforeRebuildExecution
[INFO] Compiling 47 source files to C:\dev\workspace-class\spring-mybatis-grid\target\classes
[DEBUG] incrementalBuildHelper#afterRebuildExecution
[INFO] /C:/[경로]/java/com/edu/test/NamingReflection.java: C:\dev\workspace-class\spring-mybatis-grid\src\main\java\com\edu\test\NamingReflection.java uses unchecked or unsafe operations.
[INFO] /C:/[경로]/java/com/edu/test/NamingReflection.java: Recompile with -Xlint:unchecked for details.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/[경로]/java/com/edu/test/DepartmentsServiceTest.java:[12,17] package org.junit does not exist
[ERROR] /C:/[경로]/java/com/edu/test/DepartmentsServiceTest.java:[13,24] package org.junit.runner does not exist
[ERROR] /C:/[경로]/java/com/edu/test/DepartmentsServiceTest.java:[14,40] package org.springframework.test.context does not exist
[ERROR] /C:/[경로]/java/com/edu/test/DepartmentsServiceTest.java:[15,47] package org.springframework.test.context.junit4 does not exist
[ERROR] /C:/[경로]/java/com/edu/test/DepartmentsServiceTest.java:[20,2] cannot find symbol symbol: class RunWith
[ERROR] /C:/[경로]/java/com/edu/test/DepartmentsServiceTest.java:[21,2] cannot find symbol symbol: class ContextConfiguration
오류나는 클래스를 살펴보니 모두 TEST 케이스에서만 에러난다.
패키지를 못 읽어 오는 것이기에 pom.xml 을 수정해야 한다.
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>${spring.version}</version> <scope>test</scope> </dependency>
에서 scope 를 삭제한다. 아래처럼
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>${spring.version}</version> </dependency>
'백엔드' 카테고리의 다른 글
[ElasticSearch] RestHighLevel Client 사용하기 (1) | 2020.02.14 |
---|---|
[Jenkins] 빌드 후 Tomcat 시작 할 경우 프로세스 종료 (0) | 2019.04.29 |
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". (0) | 2017.11.20 |
Java File copy with append if exits file (0) | 2012.11.14 |
EclipseLink 2.3 update URL (0) | 2011.09.09 |