Skip to content
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

maven: Immutable classes do not exist after mvn generate-sources -> problem with querydsl #1385

Open
hubchenfox opened this issue May 19, 2022 · 3 comments

Comments

@hubchenfox
Copy link

Steps to reproduce

  1. Use Immutables (within JPA entities) and QueryDSL together
  2. Run mvn clean generate-sources
  3. Immutables are not generated in this step
  4. QueryDSL (which generates the metamodel classes in the correct phase generate-sources) expects the Immutables and write error messages during the maven generate-sources phase

Note: The mvn install leads to a correct build, but error messages should be avoided

Wanted solution:
Immutable classes should be generated in the maven step "generate-sources"
This has also the advantage that even in case of compile errors the Immutables already exists and the "real error" does not hide between lots of "Immutable not found" errors.

@yatesco
Copy link

yatesco commented May 25, 2022

I think I ran into a similar problem typetools/checker-framework#5143

@hubchenfox
Copy link
Author

Quote @yatesco

I think I ran into a similar problem typetools/checker-framework#5143
Thanks for the link.
As far as I understood it, it was about two different plugins both being executed in the maven lifecycle compile, but one of them was no longer executed.
Your solution from the link:
If you run "mvn clean generate-sources", the autogenerated classes of both plugins are "missing", aren't they?
I have now got QueryDSL to generate the classes in the compile lifecylce (annotationProcessor) only but this has other disadvantages and that is why I am not so happy with it

@yatesco
Copy link

yatesco commented May 27, 2022

Yes, it was exactly that. The solution was to use "auto discovery" of the annotation processors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants