-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gradle working example #357
Comments
Hey there, only add annotationProcessor in gradle [versions]
queryDsl = "6.1"
[libraries]
#QueryDSL
queryDSLBom = { group = "io.github.openfeign.querydsl", name = "querydsl-bom", version.ref = "queryDsl" }
queryDslJPA = { group = "io.github.openfeign.querydsl", name = "querydsl-jpa", version.ref = "queryDsl" }
queryDslApt = { group = "io.github.openfeign.querydsl", name = "querydsl-apt", version.ref = "queryDsl" }
queryDslSpatial = { group = "io.github.openfeign.querydsl", name = "querydsl-spatial", version.ref = "queryDsl" }
queryDslGuava = { group = "io.github.openfeign.querydsl", name = "querydsl-guava", version.ref = "queryDsl" }
queryDslCollection = { group = "io.github.openfeign.querydsl", name = "querydsl-collections", version.ref = "queryDsl" }
queryDslCore = { group = "io.github.openfeign.querydsl", name = "querydsl-core", version.ref = "queryDsl" }
queryDslSql = { group = "io.github.openfeign.querydsl", name = "querydsl-sql", version.ref = "queryDsl" }
queryDslSqlCodeGen = { group = "io.github.openfeign.querydsl", name = "querydsl-codegen", version.ref = "queryDsl" } compileOnly("io.github.openfeign.querydsl:querydsl-apt:${libs.versions.queryDsl.get()}:jpa")
implementation(libs.queryDslJPA)
annotationProcessor("io.github.openfeign.querydsl:querydsl-apt:${libs.versions.queryDsl.get()}:jpa")
implementation(libs.queryDslCore)
implementation(libs.queryDslGuava)
implementation(libs.queryDslCollection)
implementation(libs.queryDslSpatial)
annotationProcessor(libs.jakartaPersistence) |
@fab918 we need to create a gradle plugin for querydsl. But I never got to make one. If you keen on making it happen, I'm more than happy to review and advise. This might be a good inspiration |
@DaiYuANg It doesn't work, nothing happens when I run a build with gradle, normally the classes should be generated. I tried :
I've tried the suggested configuration here querydsl/querydsl#3655, in the same way, nothing happens when I build. I tested with java 17 and 21.
@velo Why should we need a plugin to use the library on Gradle? |
@fab918 ... I am using:
Note: the latest version 9.0.7 is not compatible, but I've created a PR to move all dependencies from "com.querydsl:" to "io.github.openfeign.querydsl:" infobip/infobip-spring-data-querydsl#101. |
Any updates on this? I'm using Kotlin and Gradle and Q classes are not being generated. |
Needs someone to take charge in this initiative. I don't have the bandwidth |
@lucasdistasi I managed to make it generate the Q classes in a project with Spring Boot, Kotlin Entity classes and Kotlin Gradle file. plugins {
val kotlinVersion = "2.0.0"
kotlin("jvm") version kotlinVersion
kotlin("plugin.spring") version kotlinVersion
kotlin("plugin.jpa") version kotlinVersion
kotlin("kapt") version kotlinVersion
id("org.springframework.boot") version "3.2.5"
id("io.spring.dependency-management") version "1.1.4"
}
dependencies {
val querydslVersion = "6.7"
implementation("io.github.openfeign.querydsl:querydsl-jpa:$querydslVersion")
implementation("io.github.openfeign.querydsl:querydsl-sql:$querydslVersion")
kapt("io.github.openfeign.querydsl:querydsl-apt:$querydslVersion")
compileOnly("io.github.openfeign.querydsl:querydsl-apt:$querydslVersion:jpa")
}
kapt {
arguments {
arg("querydsl.entityAccessors", "true")
}
}
sourceSets {
main {
kotlin {
srcDir("src/main/kotlin")
}
}
test {
kotlin {
srcDir("src/test/kotlin")
}
}
} It generates the Q classes to the gradle kaptKotlin
gradle build Hope this helped. |
Seems no one is working on this, I'm closing to clear the board. Feel free to reopen after a PR is submitted. |
Hello,
I spent a few hours trying to get a project running with this version of QueryDSL. My project basically works with queryDsl v4. I'd like to update it, but I've tried everything I can't found on the Internet but and I can't get my Q classes generated with V5 and grandle. The examples on the repo are in Maven only unfortunately.
Is it possible to get help to have a minimal project that generates Q classes with Gradle?
I think it will help other people. Thanks for everything!
The text was updated successfully, but these errors were encountered: