■ build.gradle ( Querydsl 설정 )
페이지 정보
본문
plugins {
id 'java'
id 'war'
id 'org.springframework.boot' version '3.2.6'
id 'io.spring.dependency-management' version '1.1.5'
//querydsl 추가
id "com.ewerk.gradle.plugins.querydsl" version "1.0.10"
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
// Querydsl 추가
querydsl.extendsFrom compileClasspath
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jdbc'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:3.0.3'
// Querydsl 추가 ( java 17 경우 : jakarta )
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"
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'org.projectlombok:lombok'
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter-test:3.0.3'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
tasks.named('test') {
useJUnitPlatform()
}
/* 설정 추가 ---------------------------- */
def querydslDir = "src/main/generated" //생성 경로
querydsl {
library = "com.querydsl:querydsl-apt"
jpa = true
querydslDefault = true
querydslSourcesDir = querydslDir
}
//에디터 설정
sourceSets {
main {
java {
srcDirs = ['src/main/java', querydslDir]
}
}
}
//어노테이션 프로세서와 맞물려서 빌드시 생성
compileQuerydsl {
options.annotationProcessorPath = configurations.querydsl
}
/* 설정 종료 ---------------------------- */
- 이전글BoardRepository 24.06.17
- 다음글■ 쿼리 메서드 기능 , JPQL 기능 24.06.15
댓글목록
등록된 댓글이 없습니다.