-
Notifications
You must be signed in to change notification settings - Fork 509
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 example for mapstruct with Gradle 5 #66
Comments
Courtesy of M.Ricciuti on Stack Overflow who supplied me with a very good answer. It works like a charm. Setting the options and where to create the source files was a very nice bonus. Something I was hoping to see in the original Gradle examples as well. Since latest Gradle version ( >= 4.8 I would say) you can simplify your build script as follows ; you don't need apt plugin anymore, just use annotationProcessor Gradle configuration :
Note: by default, Gradle will generate sources into directory :build/generated/sources/annotationProcessor/java/main But this is configurable, for example:
|
Hey @bessels , thanks for reporting this issue and providing a possible solution! Do you like to update the gradle example and provide a PR? |
I think that this is covered by PR #54 |
The example for Gradle 5 does NOT seem to work with Gradle 5. From the release notes: Release notes Gradle 5 states: Gradle will no longer automatically apply annotation processors that are on the compile classpath — use CompileOptions.annotationProcessorPath instead.
Specifically the "options.compilerArgs = [
'-Amapstruct.suppressGeneratorTimestamp=true" part.
See also my post on StackOverflow: https://stackoverflow.com/questions/56170222/migrating-from-gradle-4-to-5-how-to-get-mapstruct-1-20-final-working-with-it
The text was updated successfully, but these errors were encountered: