강의

멘토링

커뮤니티

인프런 커뮤니티 질문&답변

마운틴님의 프로필 이미지
마운틴

작성한 질문수

스프링부트 3.0 query dsl 에러

작성

·

638

0

plugins {
   id 'java'
   id 'org.springframework.boot' version '3.0.0'
   id 'io.spring.dependency-management' version '1.1.0'
}

group = 'study'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'

configurations {
   compileOnly {
      extendsFrom annotationProcessor
   }
}

repositories {
   mavenCentral()
}

dependencies {
   implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
   implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
   implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect'
   implementation 'org.springframework.boot:spring-boot-starter-web'
   implementation 'mysql:mysql-connector-java'
   implementation 'org.mapstruct:mapstruct:1.4.2.Final'

   compileOnly 'org.projectlombok:lombok'

   annotationProcessor 'org.projectlombok:lombok'
   annotationProcessor 'org.projectlombok:lombok-mapstruct-binding:0.2.0'
   annotationProcessor "org.mapstruct:mapstruct-processor:1.4.2.Final"

   testImplementation 'org.springframework.boot:spring-boot-starter-test'
   developmentOnly 'org.springframework.boot:spring-boot-devtools'

   // Querydsl 추가
   implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
   annotationProcessor 'com.querydsl:querydsl-apt:5.0.0:jakarta'
   annotationProcessor "jakarta.annotation:jakarta.annotation-api"
   annotationProcessor "jakarta.persistence:jakarta.persistence-api"
}

tasks.named('test') {
   useJUnitPlatform()
}

 

위와 같이 설정 후 build - clean, other - compileJava 하여 Q파일 생성까지는 잘 됩니다.

 

하지만 프로젝트 실행하려고 하면 아래와 같이 오류가 발생하네요

Description:

A component required a bean of type 'jakarta.persistence.EntityManagerFactory' that could not be found.


Action:

Consider defining a bean of type 'jakarta.persistence.EntityManagerFactory' in your configuration.


Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

 

그래서 Q파일.java를 확인해보니 아래와 같이 javax를 기반으로 @Generated 어노테이션이 생성된 것을 확인했습니다.

 

이거 잡고 몇일째인지 모르겠네요 ㅜㅜ 혹시 원인을 아시는 분 계실까요??
(혹시 몰라서 config파일까지 첨부합니다.)

답변

답변을 기다리고 있는 질문이에요
첫번째 답변을 남겨보세요!
마운틴님의 프로필 이미지
마운틴

작성한 질문수

질문하기