Yar Sol
Yar Sol

Reputation: 197

Kotlin QueryDsl not generating Q classes

I'm using kts gradle with koltin. However when i try to add QueryDsl it's not genetation Q classes from my JPA entities.

My build.gradle.kts looks like:

plugins {
  id("org.springframework.boot") version "2.3.1.RELEASE"
  id("io.spring.dependency-management") version "1.0.9.RELEASE"
  kotlin("jvm") version "1.3.72"
  kotlin("plugin.spring") version "1.3.72"
  kotlin("plugin.jpa") version "1.3.72"
  kotlin("kapt") version "1.4.0"
  kotlin("plugin.allopen") version "1.4.10"
} 

dependencies {
  // some spring boot dependencies here...
  implementation("com.querydsl:querydsl-jpa:4.2.1")
  kapt("com.querydsl:querydsl-apt:4.2.1:general")
}

kapt {
 annotationProcessor("org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor")
}

I suggest it should build Q classes to build/generated/source/kapt/main. Any ideas why it's not working?
Also tried to annotate my entity with @QueryEntity annotation. Not working as well

Upvotes: 0

Views: 1166

Answers (1)

Yar Sol
Yar Sol

Reputation: 197

Issue fixed by adding next configuration

// quert dsl
implementation("com.querydsl:querydsl-jpa:4.2.1")
kapt("com.querydsl:querydsl-apt:4.2.2:jpa")
annotationProcessor(group = "com.querydsl", name = "querydsl-apt", classifier = "jpa")

Also i removed

annotationProcessor("org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor")

Upvotes: 1

Related Questions