Tuesday, September 22, 2015

QueryDSL + JPA + Gradle in IntelliJ

`build.gradle`:

apply plugin: 'idea'

idea {
    module {
        sourceDirs += file('generated/')
    }
}

dependencies {
    ...
    compile("com.mysema.querydsl:querydsl-jpa:$querydslVersion")
    compile("com.mysema.querydsl:querydsl-apt:$querydslVersion:jpa")
    ...
}

Setup IntelliJ:

File -> Settings...

Compiler -> Annotation Processors

`Enable annotation processing`

Store generated sources relative to: `Module content root`

Reference:
http://bsideup.blogspot.kr/2015/04/querydsl-with-gradle-and-idea.html

No comments:

Post a Comment