Skip to content

Commit

Permalink
Bump gRPC version and a way to override protoc-os-classifier
Browse files Browse the repository at this point in the history
  • Loading branch information
michalszynkiewicz committed Jul 26, 2021
1 parent fcde34d commit 71d0a10
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@
<google-http-client.version>1.38.0</google-http-client.version>
<scram-client.version>2.1</scram-client.version>
<!-- Make sure to check compatibility between these 2 gRPC components before upgrade -->
<grpc.version>1.35.0</grpc.version> <!-- when updating, verify if com.google.auth should not be updated too -->
<grpc-jprotoc.version>1.0.1</grpc-jprotoc.version>
<protobuf-java.version>3.14.0</protobuf-java.version>
<grpc.version>1.38.1</grpc.version> <!-- when updating, verify if com.google.auth should not be updated too -->
<grpc-jprotoc.version>1.2.0</grpc-jprotoc.version>
<protobuf-java.version>3.17.3</protobuf-java.version>
<protoc.version>${protobuf-java.version}</protoc.version>
<picocli.version>4.6.1</picocli.version>
<google-cloud-functions.version>1.0.1</google-cloud-functions.version>
Expand Down
5 changes: 4 additions & 1 deletion docs/src/main/asciidoc/grpc-getting-started.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,12 @@ With this configuration, you can put your service and message definitions in the
`quarkus-maven-plugin` will generate Java files from your `proto` files.

`quarkus-maven-plugin` retrieves a version of `protoc` (the protobuf compiler) from Maven repositories. The retrieved version matches your operating system and CPU architecture.
If this retrieved version does not work in your context, you can download the suitable binary and specify the location via
If this retrieved version does not work in your context, you can either force to use a different OS classifier with
`-Dquarkus.grpc.protoc-os-classifier=your-os-classifier` (e.g. `osx-x86_64`).
You can also download the suitable binary and specify the location via
`-Dquarkus.grpc.protoc-path=/path/to/protoc`.


Alternatively to using the `generate-code` goal of the `quarkus-maven-plugin`, you can use `protobuf-maven-plugin` to generate these files, more in <<Generating Java files from proto with protobuf-maven-plugin>>

Let's start with a simple _Hello_ service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public boolean trigger(CodeGenContext context) throws CodeGenException {
int resultCode = process.waitFor();
if (resultCode != 0) {
throw new CodeGenException("Failed to generate Java classes from proto files: " + protoFiles +
" to " + outDir.toAbsolutePath().toString());
" to " + outDir.toAbsolutePath());
}
return true;
}
Expand Down Expand Up @@ -199,7 +199,7 @@ private void initExecutables(Path workDir, AppModel model) throws CodeGenExcepti
if (executables == null) {
Path protocPath;
String protocPathProperty = System.getProperty("quarkus.grpc.protoc-path");
String classifier = osClassifier();
String classifier = System.getProperty("quarkus.grpc.protoc-os-classifier", osClassifier());
if (protocPathProperty == null) {
protocPath = findArtifactPath(model, PROTOC_GROUPID, PROTOC, classifier, EXE);
} else {
Expand Down Expand Up @@ -310,7 +310,7 @@ private static Path writeScript(Path buildDir, Path pluginPath, String shebang,

private static void writePluginExeCmd(Path pluginPath, BufferedWriter writer) throws IOException {
writer.write("\"" + JavaBinFinder.findBin() + "\" -cp \"" +
pluginPath.toAbsolutePath().toString() + "\" " + quarkusProtocPluginMain);
pluginPath.toAbsolutePath() + "\" " + quarkusProtocPluginMain);
writer.newLine();
}

Expand Down

0 comments on commit 71d0a10

Please sign in to comment.