diff --git a/be/.gitignore b/be/.gitignore index cb3ddb2..3e81b7c 100644 --- a/be/.gitignore +++ b/be/.gitignore @@ -5,6 +5,9 @@ build/ !**/src/main/**/build/ !**/src/test/**/build/ +### Querydsl +src/main/generated + ### STS ### .apt_generated .classpath diff --git a/be/build.gradle b/be/build.gradle index 2eb0918..839700d 100644 --- a/be/build.gradle +++ b/be/build.gradle @@ -70,6 +70,14 @@ dependencies { implementation 'io.awspring.cloud:spring-cloud-starter-aws:2.4.2' implementation 'com.amazonaws:aws-java-sdk-s3' testImplementation 'io.findify:s3mock_2.13:0.2.6' + + // Querydsl + implementation "com.querydsl:querydsl-jpa" + implementation "com.querydsl:querydsl-core" + implementation "com.querydsl:querydsl-collections" + annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jpa" // querydsl JPAAnnotationProcessor 사용 지정 + annotationProcessor "jakarta.annotation:jakarta.annotation-api" // java.lang.NoClassDefFoundError (javax.annotation.Generated) 대응 코드 + annotationProcessor "jakarta.persistence:jakarta.persistence-api" // java.lang.NoClassDefFoundError (javax.annotation.Entity) 대응 코드 } tasks.named('test') { @@ -85,4 +93,20 @@ task copyGitSubmodule(type: Copy) { include 'db/**' } +// Querydsl 설정부 +def generated = 'src/main/generated' + +// querydsl QClass 파일 생성 위치를 지정 +tasks.withType(JavaCompile) { + options.getGeneratedSourceOutputDirectory().set(file(generated)) +} + +// java source set 에 querydsl QClass 위치 추가 +sourceSets { + main.java.srcDirs += [ generated ] +} +// gradle clean 시에 QClass 디렉토리 삭제 +clean { + delete file(generated) +} \ No newline at end of file