• A module contains proto files emits the following error when it’s compiled with line-gradle-scripts grpc preset.

    $ ./gradlew clean :protocol:build
    Type-safe dependency accessors is an incubating feature.
    > Task :protocol:sourcesJar FAILED
    FAILURE: Build failed with an exception.
    * What went wrong:
    Execution failed for task ':protocol:sourcesJar'.
    > Entry com/example/foo/ is a duplicate but no duplicate handling strategy has been set. Please refer to for details.


  • Files under gen-src/main/java gets registered twice as sourceSet once by line-gradle-scripts at java.gradle:L58 and again by protobuf-gradle-plugin.


  1. Comment out java.gradle:L58
  2. Define Jar task duplicatesStrategy as follows:

    tasks.withType<Jar> {
        duplicatesStrategy = DuplicatesStrategy.INCLUDE


View Github