Target generated sources in a Gradle project #3828
Unanswered
kristof-taveirne
asked this question in
Q&A
Replies: 1 comment
-
MapStruct is an annotation processor, which means that it is invoked by the Java compiler. If you want to change the location of the generated files, then you'll need to configure the Gradle compilation task for that. Apparently in Gradle 8.14 this is Hope this helps |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Is there a way to specify the target folder for the generated sources in a Gradle project?
By default it goes to build/generated/sources/annotationProcessor/java/main/...
In our project there is a lot of code generation going on and the code typically goes to src/generated
We have our own Gradle plugin for our code generation, and when I enable that in the module where the MapStruct things are, MapStruct generated sources go to src/generated/generated.
So, in order for MapStruct to sit nicely in our codebase it would be helpful if I would have some control on where the sources are generated. I see in the documentation that it's possible in case of an Ant build, but it's not specified in case of a Gradle build.
Thanks!
Kristof
Beta Was this translation helpful? Give feedback.
All reactions