본문 바로가기
[IT]/Querydsl

[Query DSL] package com.querydsl.core.types does not exist

by dop 2021. 4. 17.

Q-Type Error : package com.querydsl.core.types does not exist

얼마전에 발생한 Q-Type 에러가 또 다시 발생했다.. @Builder를 사용하면서 해결했었는데,이번에는 Lombok 어노테이션을 인식하지 못하는 문제가 발생했다.

에러메세지로 구글링 하던 중 동일한 문제로 어려움을 겪는 케이스를 발견했다!

www.inflearn.com/questions/23530

gradle 6.0 이상 버전과 lombok사이에 호환성 문제가 있는 것 같다.

plugin 부분에 id "io.franzbecker.gradle-lombok" version "3.0.0" 를 추가하니 정상적으로 동작했다.
franzbecker 는 lombok 어노테이션의 프로세스를 단순화하는 플러그인이라고 한다.

[21.04.18] 01:07
JPS incremental annotation processing is disabled. Compilation results on partial recompilation may be inaccurate. Use build process "jps.track.ap.dependencies" VM flag to enable/disable incremental annotation processing environment.

DataJpaTest org.hibernate.PersistentObjectException: detached entity passed to persist:

lombok최신버전적용, annotation processor 도 체크도 되어있는 상태였지만, 해결 x
Setting > Build, Execution, Deployment > Compiler > Shared build process VM options 에 -Djps.track.ap.dependencies=
같은 설정도 변경해봤지만 해결되지 않음.

잘 실행되는 줄 알았으나 계속해서 동일오류 발생, 커뮤니티에 공유 후 해결방법 터득
gradlew clean / build 로 gradle 캐시 초기화로 해결.(정확한 이유는 모르겠으나 캐시에 남은것으로 실행되면서 문제가 생긴 것 같다)
가장 이상한 점은 이전에 gradle의존성 (어떤것이든) 삭제하면 문제가 생기고, 추가하면 실행은 되었던 것.

728x90

'[IT] > Querydsl' 카테고리의 다른 글

[QueryDSL] Query DSL 기본문법  (0) 2021.03.26
[QueryDSL] JPQL vs Query DSL  (0) 2021.03.26
[QueryDSL] 인텔리제이 환경설정  (0) 2021.03.26