-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Make hibernate-jpamodelgen easier to apply to Quarkus 3.7+ projects #37477
Comments
Hey @FroMage , would your current work on annotation processors in Quarkus help in any way, by chance? |
Hey @gsmet and @geoand , I seem to remember you talking to people maintaining Maven plugins to resolve some problems some time ago... would you have contacts working on Maven Compiler Plugin, by chance? A release of Maven Compiler Plugin 3.12.0 before the release of Quarkus 3.7 would make the issue largely irrelevant, but given how this project hasn't seen many releases this year, I don't know how likely this is. |
I personally do not unfortunately |
Hey @gnodet , Do you know if it would be possible to release a new Maven Compiler Plugin version or do you know someone who could trigger a release? We are eagerly waiting for https://issues.apache.org/jira/browse/MCOMPILER-391 to be released as it's really important for the Hibernate ORM annotation processor (see the description of the issue for the details). Thanks! |
Well, yeah. My branch makes this sort of set up work in DEV mode, which it does not ATM. The PR is at #37044 but it's sorta stuck pending review and help because I don't know how to write tests for this, or how to make it work for Gradle. |
Also note that there's #29068 to make this plugin run automatically, which is sorta also blocked pending help from the IDE folks. |
To be cristal clear:
|
Hello |
Hello. This particular issue is not about making it possible to use jpamodelgen, but about making it easier. It already works for Java users, it's just that it will become inconvenient in Quarkus 3.7 if we don't do anything. I'd suggest opening an issue with a clear description (version of Quarkus, stacktrace, ...) and reproducer. Hopefully someone with more Gradle/Kotlin knowledge than me will be able to look into this. |
Hey @gnodet , gentle reminder of ^ :) |
FYI, release vote was started yesterday evening. So I think we can expect maven-compiler-plugin 3.12.0 very soon. |
maven-compiler-plugin 3.12.0 and I've got reports that dependency management indeed works fine for We'll need to upgrade in Quarkus, and maybe add recipes to |
I updated the migration guide. Still:
|
Thanks @famod ; from what I understand this could easily be solved on our end by adding dependency management for |
Yes, that should work. But I don't think it should be there forever, should be dropped for 4.x at the latest (whenever that will be). |
Yeah, I had the same thought the other day. Let's do it and we can drop it at some point. |
Ok, so to sum up:
|
We could probably handle 2. by having a look at https://docs.openrewrite.org/recipes/maven/changepluginconfiguration and create a custom recipe based on this code. One other thing I was wondering: should we provide a codestart for Hibernate ORM to contribute the annotation processor config to the POM? Or do we want it to be kept optional? |
Personally I'd wait and see how #37044 turns out, because right now we know such annotation processors won't be run again when restarting the app in dev mode, which leads to a poor dev experience. That's true regardless of how annotation processors are defined ( |
I verified in #37044 that the latest plugin uses managed versions. But I'm stuck in |
Works now. |
Sorry guys, I just realized I was ping'ed on this issue. If you need anything, let me know... |
Thanks :) I think we're good now, as Maven Compiler Plugin 3.12.1 behaves pretty much like we need it to :) |
FWIW kotlin-maven-plugin latest (1.9.22) also doesn't handle dependency management for See https://youtrack.jetbrains.com/issue/KT-59521, JetBrains/kotlin@a3583ea See also #38558 (comment) |
Removes workaround for HHH-17683 in Panache. We need to keep specifying the version for Kotlin extensions due to kotlin-maven-plugin not taking dependency management into account; see quarkusio#37477 (comment). However, we now use the same version as the one we expect people to use in applications (6.4.3), so it's no longer so much of a hack. This reverts commit f4b489b. This reverts commit e745fe3.
Removes workaround for HHH-17683 in Panache. We need to keep specifying the version for Kotlin extensions due to kotlin-maven-plugin not taking dependency management into account; see quarkusio#37477 (comment). However, we now use the same version as the one we expect people to use in applications (6.4.3), so it's no longer so much of a hack. This reverts commit f4b489b. This reverts commit e745fe3. (cherry picked from commit c62dc92)
Description
In Quarkus 3.7, Hibernate ORM's "JPAModelGen" annotation processor can no longer simply be dropped into the compile path as a "provided" dependency, because it now has dependencies of its own.
See #37460 and in particular 9e072ed:
Long story short, the proper way to use this annotation processor (and, really, annotation processors in general) is to add the processor, not to the compile path, but to the annotation processor path:
This is fine and this is already what we recommend in the migration guide.
However, as documented in the migration guide, the BOM won't be applied to Maven's
annotationProcessorPath
entry and the version ofhibernate-jpamodel
will have to be specified explicitly by every application. That's inconvenient.This should be solved in Maven Compiler Plugin version 3.12.0 (see https://issues.apache.org/jira/browse/MCOMPILER-391), but 3.11 was released back in February 2023 and the plugin hasn't seen a release since :/
Implementation ideas
No response
The text was updated successfully, but these errors were encountered: