plugins { id 'com.google.protobuf' version '0.9.4' // Generate IntelliJ IDEA's .idea & .iml project files id 'idea' id 'war' } repositories { mavenCentral() mavenLocal() } java { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } def grpcVersion = '1.70.0' // CURRENT_GRPC_VERSION def protocVersion = '3.25.5' dependencies { implementation "io.grpc:grpc-protobuf:${grpcVersion}", "io.grpc:grpc-servlet:${grpcVersion}", "io.grpc:grpc-stub:${grpcVersion}" compileOnly "javax.servlet:javax.servlet-api:4.0.1", "org.apache.tomcat:annotations-api:6.0.53" } protobuf { protoc { artifact = "com.google.protobuf:protoc:${protocVersion}" } plugins { grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" } } generateProtoTasks { all()*.plugins { grpc {} } } } // Inform IDEs like IntelliJ IDEA, Eclipse or NetBeans about the generated code. sourceSets { main { java { srcDirs 'build/generated/source/proto/main/grpc' srcDirs 'build/generated/source/proto/main/java' } } }