build.gradle을 아래와같이 설정해준다.
추가하는 코드중에 s라던지 오타가 있으면 에러가 나온다. (스프링 부트 3버전 기준)
plugins {
id 'java'
id 'org.springframework.boot' version '3.1.10'
id 'io.spring.dependency-management' version '1.1.4'
//querydsl 추가
// id "com.ewerk.gradle.plugins.querydsl" version "1.0.10"
}
group = 'study'
version = '0.0.1-SNAPSHOT'
java {
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-web'
//Querydsl 추가
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jakarta"
annotationProcessor "jakarta.annotation:jakarta.annotation-api"
annotationProcessor "jakarta.persistence:jakarta.persistence-api"
implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.5.8'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
//tasks.named('bootBuildImage') {
// builder = 'paketobuildpacks/builder-jammy-base:latest'
//}
//
//tasks.named('test') {
// useJUnitPlatform()
//}
//querydsl 추가 시작
//def querydslDir = "$buildDir/generated/querydsl"
//
//querydsl {
// jpa = true
// querydslSourcesDir = querydslDir
//}
//sourceSets {
// main.java.srcDir querydslDir
//}
//configurations {
// querydsl.extendsFrom compileClasspath
//}
//compileQuerydsl {
// options.annotationProcessorPath = configurations.querydsl
//}
//querydsl 추가 끝
'Back End > Spring Boot' 카테고리의 다른 글
SpringBoot의 세가지 Annotation(@SpringBootConfiguration, @ComponentScan, @EnableAutoConfiguration) (0) | 2024.06.24 |
---|---|
Querydsl 조회 (0) | 2024.04.15 |
JPQL 검색조건 (0) | 2024.04.15 |
Spring Actuator 스프링 액츄에어터 (0) | 2024.03.17 |
스프링부트 개요 (0) | 2023.08.22 |