-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Avoid generated-sources clash with MapStruct in codegen #11312
Conversation
FTR, there is an alternate approach: #11311 |
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
@michalszynkiewicz it would be great if you could have a look at this. Btw, this PR does not change the unconditional execution of the prepare goal by the dev goal. |
|
Not directly related, but it seems that MapStruct should also generate sources in a disjunct subdirectory, avoiding using the |
@gastaldi It is implicitly using |
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.
Let's wait for @aloubyansky and @michalszynkiewicz 's approvals before merging this one.
@famod please don't set older versions. I do it when backporting. Until then it must target master and have the |
@gsmet Ok, will do. I actually had a look at the new COMMITTERS.md and was still a bit unsure after that. |
I think the proper fix may be to remove the following line instead, checking it
|
PR for ^ #11328 |
FTR, I left a comment at #11328. Summary: A dedicated subdirectory still seems like the cleanest solution, IHMO. |
With #11328 now merged, this PR has become optional. If we want to make extra sure to avoid clashes it can be merged, otherwise it should be closed. |
On one hand, we are even more separate with changing |
@aloubyansky WDYT? |
I think it makes sense. If you execute |
What we have now in master puts the "normal" generated sources in the The test mojo adds stuff as test compile source root: https://github.com/quarkusio/quarkus/blob/master/devtools/maven/src/main/java/io/quarkus/maven/CodeGenTestMojo.java#L18 While the normal one adds it as a compile source root: https://github.com/quarkusio/quarkus/blob/master/devtools/maven/src/main/java/io/quarkus/maven/CodeGenMojo.java#L62 I don't think the test classes would sneak into user's app. This PR shouldn't change this behavior |
Then it's your call @michalszynkiewicz |
Glad I could help! |
Fixes #11253
This avoids recreation attempts of annotation processors like MapStruct that are writing to
${project.build.directory}/generated-sources/annotations
by default.See also: http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#generatedSourcesDirectory
The additon of
${project.build.directory}/generated-sources
byCodeGenMojo
seems to make MapStruct (or any other processor) see its own output a second time. This change is preventing this by introducing a disjunct subdirectory.