Gradle 7 build 설정 (KotlinDSL)
build.gradle.kts
import com.ewerk.gradle.plugins.tasks.QuerydslCompile
plugins {
java
id("org.springframework.boot") version "2.7.10"
id("io.spring.dependency-management") version "1.0.15.RELEASE"
id("com.ewerk.gradle.plugins.querydsl") version "1.0.10"
}
group = "study"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_11
val queryDslVersion = "5.0.0"
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.querydsl:querydsl-jpa:${queryDslVersion}")
annotationProcessor("com.querydsl:querydsl-apt:${queryDslVersion}")
compileOnly("org.projectlombok:lombok")
developmentOnly("org.springframework.boot:spring-boot-devtools")
runtimeOnly("com.h2database:h2")
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
annotationProcessor("org.projectlombok:lombok")
testImplementation("org.springframework.boot:spring-boot-starter-test")
}
tasks.withType<Test> {
useJUnitPlatform()
}
val querydslDir = "$buildDir/generated/querydsl"
querydsl {
jpa = true
querydslSourcesDir = querydslDir
}
sourceSets.getByName("main") {
java.srcDir(querydslDir)
}
configurations {
named("querydsl") {
extendsFrom(configurations.compileClasspath.get())
}
}
tasks.withType<QuerydslCompile> {
options.annotationProcessorPath = configurations.querydsl.get()
}
안녕하세요. 남재근님, 공식 서포터즈 OMG입니다.
정보 공유 감사합니다^^
답글