reactive-grpc icon indicating copy to clipboard operation
reactive-grpc copied to clipboard

Gradle example fails on linux

Open dsyer opened this issue 1 year ago • 2 comments

The example from the README fails like this for me:

...
> Task :generateProto FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':generateProto'.
> Could not resolve all files for configuration ':protobufToolsLocator_reactor'.
   > Could not find reactor-grpc-1.2.4-linux-x86_64.exe (com.salesforce.servicelibs:reactor-grpc:1.2.4).
     Searched in the following locations:
         file:/home/dsyer/.m2/repository/com/salesforce/servicelibs/reactor-grpc/1.2.4/reactor-grpc-1.2.4-linux-x86_64.exe
...

I can see that .exe file in Maven Central. It works with Maven.

UPDATE: (hopefully useful for others in the same pickle, including future me) it works for me if you put mavenLocal() after mavenCentral() in the repositories declaration. So someone, somewhere is not taking into account all the repositories.

dsyer avatar Jan 17 '25 14:01 dsyer

Try replacing reactor-grpc with reactive-grpc in your config.

rmichela avatar Jan 17 '25 14:01 rmichela

Not sure where exactly you mean I should do that. Here's the result:

> Task :generateProto FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':generateProto'.
> Could not resolve all files for configuration ':protobufToolsLocator_reactor'.
   > Could not find reactive-grpc-1.2.4-linux-x86_64.exe (com.salesforce.servicelibs:reactive-grpc:1.2.4).
     Searched in the following locations:
         https://repo.maven.apache.org/maven2/com/salesforce/servicelibs/reactive-grpc/1.2.4/reactive-grpc-1.2.4-linux-x86_64.exe

when I put

protobuf {
    protoc {
        artifact = "com.google.protobuf:protoc:${dependencyManagement.importedProperties['protobuf-java.version']}"
    }
    plugins {
        grpc {
            artifact = "io.grpc:protoc-gen-grpc-java:${dependencyManagement.importedProperties['grpc.version']}"
        }
        reactor {
            artifact = "com.salesforce.servicelibs:reactive-grpc:1.2.4"
        }
    }
    generateProtoTasks {
        all()*.plugins {
            grpc {
                option 'jakarta_omit'
                option '@generated=omit'
            }
            reactor {}
        }
    }
}

dsyer avatar Jan 17 '25 15:01 dsyer