2

My annotation processing has suddenly stopped working. I've made no known changes to my configuration and haven't been able to find any references to the error I'm getting.

Gradle Version: 7.5.1
QueryDSL Version: 5.0.0

build.gradle:

implementation "com.querydsl:querydsl-core:${querydslVersion}"
implementation "com.querydsl:querydsl-jpa:${querydslVersion}"
implementation "com.querydsl:querydsl-apt:${querydslVersion}"
...
annotationProcessor ("javax.annotation:javax.annotation-api:1.3.2")
annotationProcessor ("org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final")
annotationProcessor ("com.querydsl:querydsl-apt:${querydslVersion}")
annotationProcessor ("com.querydsl:querydsl-apt:${querydslVersion}:jpa")

Error:

* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':annotationProcessor'.
   > Could not find querydsl-apt-5.0.0-jpa.jar (com.querydsl:querydsl-apt:5.0.0).
     Searched in the following locations:
         file:/Users/devuser/.m2/repository/com/querydsl/querydsl-apt/5.0.0/querydsl-apt-5.0.0-jpa.jar

Found a work around (9/24):

The version of querydsl-jpa is controlled by my JHipster BOM, which pulls in 5.0.0. But if I specify the 4.4.0 version in my annotation processor it works. So it seems like the behavior changed in 5.0.0, or the classifier needs to be specified in some other way. But this is how I got it to work again.

implementation group: 'com.querydsl', name:'querydsl-jpa', version:'+'
annotationProcessor group: 'com.querydsl', name: 'querydsl-apt', classifier: 'jpa', version: '4.4.0'

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.