시간이 없으신 분들을 위한 선 요약 세팅

(Use this setting)

plugins {
    id 'org.springframework.boot' version '2.6.2'
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    id 'java'
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
    maven { url "https://plugins.gradle.org/m2/" } // 플러그인 저장소
}

dependencies {
    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'
    compileOnly 'org.projectlombok:lombok'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    runtimeOnly 'com.h2database:h2'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'

    // QueryDSL
    implementation "com.querydsl:querydsl-jpa:5.0.0"
    implementation "com.querydsl:querydsl-core:5.0.0"
    annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jpa"
    annotationProcessor 'org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final'
    annotationProcessor 'javax.annotation:javax.annotation-api:1.3.2'
}

test {
    useJUnitPlatform()
}

 

 

---------------------------------------------------

(Don't use this setting )

QueryDsl 세팅에 애를 먹는 경우가 많다 4 버전 대에는 특히 심했는데, 아래와 같은 코드를 추가해줬었다

 

여러 페이지들을 검색하며 세팅하였으나 공유하여 다른 사람이 쓰면 안되는 등 골치가 아팠다.

하지만 5버전을 세팅하면서 부터인지 위와 같은 복잡한 세팅이 필요 없어진 듯하다.

맨 위에 보이는 세팅처럼 //QueryDsl 부분만 추가해주면 따로 설정이 필요없이 잘 작동 될 것이다.

+ Recent posts