plugins { id "com.google.protobuf" version "0.9.2" id "java" id "net.idlestate.gradle-duplicate-classes-check" version "1.2.0" } group 'com.gitlab.techschool' version '1.0-SNAPSHOT' java { toolchain { languageVersion = JavaLanguageVersion.of(11) } } repositories { mavenCentral() } dependencies { testImplementation group: 'junit', name: 'junit', version: '4.13.2' implementation group: 'com.google.protobuf', name: 'protobuf-java', version: '3.22.0' // implementation group: 'io.grpc', name: 'grpc-all', version: '1.53.0' } sourceSets { main { proto { srcDir 'src/main/proto/messages' include '**/*.proto' } java { srcDirs 'src/main/java' // Changed 'main/java' to 'src/main/java' } } } protobuf { // generatedFilesBaseDir = "src/" protoc { artifact = 'com.google.protobuf:protoc:3.22.0' } plugins { grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.53.0' } doc { artifact = "io.github.pseudomuto:protoc-gen-doc:1.5.1" } } generateProtoTasks { all().each { task -> task.builtins { java { outputSubDir = 'src/main/java' } cpp {} } task.plugins { doc { option 'html, v2c.html' } } } processResources { duplicatesStrategy = 'EXCLUDE' } } }