I have sources in both java and groovy, and when the modularity plugin is enabled it generated duplicate classes:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':jar'.
> Entry net/fortuna/ical4j/validate/PropertyRuleSet.class is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/8.4/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy for details.
If I exclude the groovy source files (or not enbale groovy and modularity plugin at the same time) the error goes away.