-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add recipe to configure the JPA Modelgen annotation processor #106
Conversation
@timtebeek I was wondering if you would be interested in us contributing these two generic recipes? They are relatively specific but I suppose they could be useful?
(name says it all) Please have a look and let me know if they make sense and if changes would be needed (except adding more tests to cover all the use cases of the recipes), the tests in our repo are solely intented to test our upgrades. No problem if you think they are too specific. Thanks. |
Hi @gsmet would definitely be open to receiving those, and thanks for the offer! At first glance these look good, but I'll get behind my laptop for a full review once there's a PR to OpenRewrite/rewrite. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Since you asked, here are a few more cases you might want to test (sorry!):
- When the version of
hibernate-jpamodelgen
is managed through the Quarkus BOM - When the version of
hibernate-jpamodelgen
is managed through a custom<dependencyManagement>
section - When
hibernate-jpamodelgen
is added as a dependency of the plugin. I have no idea how legimate that is, but I know we've used that in another project with another annotation processor plugin and it at least had an effect... - When some (all?) of the configuration of the maven-compiler-plugin is defined through
<pluginManagement>
. - When
maven-compiler-plugin
has extra configuration, in particular an explicit<annotationProcessors
> - When annotation processing configuration is more complex, e.g. with a custom execution, when using
<proc>none</proc>
/<proc>only</proc>
in some executions, processing test classes, ... - When the application uses
org.bsc.maven:maven-processor-plugin
for annotation processing. Maybe we should not mess with that, considering the configuration of that plugin can get quite complex, but a test checking what happens in that case (especially if annotation processing is disabled in maven-compiler-plugin) wouldn't hurt?
I doubt you can test it all, but I thought I'd bring it to your attention so that you can decide what is worth the effort.
|
|
@famod so if I understand correctly, I should drop hibernate-jpamodelgen from the Maven Compiler Plugin dependencies if present so that we only have the |
Well, that's where it gets complicated: But I have just found a more pressing issue: Eclipse IDE (or better to say m2e) does not seem take a |
PS: Reported the Eclipse IDE/m2e issue here: eclipse-m2e/m2e-core#1644 |
@gsmet @yrodiere just want to make sure my previous comments didn't fall through the cracks: |
From experience, bugs in ECJ can take a very long time to get fixed (not sure why exactly, I'm not blaming anyone). In the meantime... Basically, people using Eclipse need to specify the version of We can amend the migration guide to mention this. For EDIT: Though if people were using a |
I agree, but in this case m2e (the Maven integration plugin) has to be adjusted instead of EJC: eclipse-m2e/m2e-core#1644
Correct!
+1!
Well, an explicit version in |
I don't know for
+1 I think that would work. @gsmet?
But then if they're using Eclipse, they're used to that! ... okay that was too easy. Just a joke, Eclipse is great too :) |
Done |
I guess I was asking for it. ;-) |
just one thing - this not only affect Eclipse; it affects vscode and any web based IDE too. |
Ok, I updated the migration guide. |
FWIW, I'm working on adjusting the recipes. |
See #118 for the necessary adjustments. |
Btw, Eclipse 2.5.1 is planned for end of February: https://github.com/eclipse-m2e/m2e-core/blob/master/RELEASE_NOTES.md#251 |
@famod @yrodiere could you have a look at the tests and make sure that's what we want? I tried to cover as many cases as I could think of but I might have forgotten some.