docs: use annotationProcessorPaths so query types generate on JDK 23+ - #1896
Merged
Conversation
Signed-off-by: Marvin Froeder <velo.br@gmail.com>
Closed
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1880.
The documented
maven-compiler-pluginsetup does not generate query types. I reproduced it on JDK 25 and JDK 21 with a minimal one-entity project.What was wrong
The docs put
querydsl-aptin the compiler plugin's<dependencies>block. That populates the plugin's classloader, notjavac's annotation processor path, so the processor is never discovered. The build exitsBUILD SUCCESSwith no warning and noQclasses.The reporter attributed this to implicit annotation processing being disabled in JDK 23. That is not the cause for this config — it fails on JDK 21 too, and adding
<proc>full</proc>alone does not rescue it:<dependencies>(what the docs said)<proc>full</proc><proc>full</proc>annotationProcessorPaths+<proc>full</proc>So there were two independent breakages: the documented config never worked, and the project-dependency style used by the examples regressed on JDK 23+.
annotationProcessorPaths+<proc>full</proc>fixes both, and keeps the processor off the compile and runtime classpath.Changes
Converted every
querydsl-aptsnippet indocs/toannotationProcessorPathswith<proc>full</proc>, and added a note explaining the JDK 23+ behaviour to the JPA tutorial and the code generation guide.Two extra fixes found while verifying each classifier:
docs/tutorials/hibernate.mdsaid to configureHibernateAnnotationProcessorbut showed<classifier>jpa</classifier>, which selectsJPAAnnotationProcessor. Corrected tohibernate, withhibernate-coreadded to the processor path (it istestscope onquerydsl-apt, so it is not resolved transitively).docs/tutorials/mongodb.mdneedsmorphia-core(providedscope) andquerydsl-mongodbon the processor path. Without them the build fails withNoClassDefFoundError: dev/morphia/annotations/Entityand thenClassNotFoundException: com.querydsl.mongodb.Point.jakarta.persistence-apiis not required on the processor path — it is a compile-scope dependency ofquerydsl-aptand resolves transitively — so it has been dropped from the JPA snippets rather than carried over as the issue suggested.Verification
Every snippet was executed as a real Maven build on JDK 25, each generating the expected query type:
jpaquerydsl-apt:jpaQPersonhibernate+ hibernate-coreQPersongeneralquerydsl-apt:generalQCatmorphia+ morphia-core, querydsl-mongodbQDogThe
compilerArgsvariant in the code generation guide was also verified to still apply alongsideannotationProcessorPaths.Docs-only change; no source or build files touched.
🤖 Generated with Claude Code