java-sdk icon indicating copy to clipboard operation
java-sdk copied to clipboard

<protocVersion>${protobuf.version}</protocVersion>failed to mvn install.

Open darren-wang opened this issue 4 years ago • 3 comments

Ask your question here

I'm using IDEA's bundled maven(3.6.3) installing java-sdk's master branch into my local env, however,

<protocVersion>${protobuf.version}</protocVersion>

in dapr-sdk-autogen and dapr-sdk-examples poms failed. reporting:

[INFO] --- protoc-jar-maven-plugin:3.11.4:run (default) @ dapr-sdk-autogen ---
[INFO] Protoc version: 3.13.0
protoc-jar: protoc version: 3.13.0, detected platform: windows-x86_64 (windows 10/amd64)
protoc-jar: downloading: http://repo2.maven.org/maven2/com/google/protobuf/protoc/maven-metadata.xml
protoc-jar: downloading: http://repo2.maven.org/maven2/com/github/os72/protoc/maven-metadata.xml
protoc-jar: downloading: http://repo2.maven.org/maven2/com/google/protobuf/protoc/maven-metadata.xml
protoc-jar: downloading: http://repo2.maven.org/maven2/com/github/os72/protoc/maven-metadata.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  21.838 s
[INFO] Finished at: 2021-01-26T12:32:00+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.os72:protoc-jar-maven-plugin:3.11.4:run (default) on project dapr-sdk-autogen: Error extracting protoc for version 3.13.0: Unsupported platform: protoc-3.13.0-windows-x86_64.exe -> [Help 1]

it will build correctly after I change it to:

<protocArtifact>com.google.protobuf:protoc:${protobuf.version}</protocArtifact>

according to: https://github.com/os72/protoc-jar-maven-plugin/issues/68

so, why is problem happen, and should we change it to the protocArtifact?

darren-wang avatar Jan 26 '21 04:01 darren-wang

It's been a while the last time we built it on Windows. We don't see this problem on macOS or Linux. I am using the same Maven version as you. Can you repro this on Linux? Just to confirm, this change in settings will not make a difference in the generated code, right? I will confirm by myself but wants to make sure you tested that to catch this early.

artursouza avatar Jan 31 '21 01:01 artursouza

It's been a while the last time we built it on Windows. We don't see this problem on macOS or Linux. I am using the same Maven version as you. Can you repro this on Linux? Just to confirm, this change in settings will not make a difference in the generated code, right? I will confirm by myself but wants to make sure you tested that to catch this early.

[INFO] --- protoc-jar-maven-plugin:3.11.4:run (default) @ dapr-sdk-autogen ---
[INFO] Protoc version: 3.13.0
protoc-jar: protoc version: 3.13.0, detected platform: linux-x86_64 (linux/amd64)
protoc-jar: cached: /tmp/protocjar.webcache/com/google/protobuf/protoc/maven-metadata.xml
[Fatal Error] maven-metadata.xml:1:50: White spaces are required between publicId and systemId.
protoc-jar: cached: /tmp/protocjar.webcache/com/google/protobuf/protoc/3.13.0/protoc-3.13.0-linux-x86_64.exe
protoc-jar: executing: [/tmp/protocjar11922424117142267978/bin/protoc.exe, --version]
[INFO] Protoc command: /tmp/protocjar11922424117142267978/bin/protoc.exe
[INFO] Additional include types: /tmp/protocjar144442318840920881/include
/tmp/protocjar11922424117142267978/bin/protoc.exe: 1: cannot open !DOCTYPE: No such file
/tmp/protocjar11922424117142267978/bin/protoc.exe: 1: HTML: not found
/tmp/protocjar11922424117142267978/bin/protoc.exe: 2: cannot open html: No such file
/tmp/protocjar11922424117142267978/bin/protoc.exe: 3: Syntax error: redirection unexpected
[INFO]     proto2/include/google/protobuf/descriptor.proto
[INFO]     proto3/include/google/protobuf/any.proto
[INFO]     proto3/include/google/protobuf/api.proto
[INFO]     proto3/include/google/protobuf/compiler/plugin.proto
[INFO]     proto3/include/google/protobuf/descriptor.proto
[INFO]     proto3/include/google/protobuf/duration.proto
[INFO]     proto3/include/google/protobuf/empty.proto
[INFO]     proto3/include/google/protobuf/field_mask.proto
[INFO]     proto3/include/google/protobuf/source_context.proto
[INFO]     proto3/include/google/protobuf/struct.proto
[INFO]     proto3/include/google/protobuf/timestamp.proto
[INFO]     proto3/include/google/protobuf/type.proto
[INFO]     proto3/include/google/protobuf/wrappers.proto
[INFO] Input directories:
[INFO]     /home/darren/java-sdk/sdk-autogen/target/proto/dapr/proto/common/v1
[INFO]     /home/darren/java-sdk/sdk-autogen/target/proto
[INFO] Include directories:
[INFO]     /tmp/protocjar144442318840920881/include
[INFO] Output targets:
[INFO]     java: /home/darren/java-sdk/sdk-autogen/target/generated-sources (add: main, clean: false, plugin: null, outputOptions: null)
[INFO]     grpc-java: /home/darren/java-sdk/sdk-autogen/target/generated-sources (add: main, clean: false, plugin: null, outputOptions: null)
[INFO] /home/darren/java-sdk/sdk-autogen/target/generated-sources does not exist. Creating...
[INFO] Resolving artifact: io.grpc:protoc-gen-grpc-java:1.33.1, platform: linux-x86_64
[INFO]     Processing (java): common.proto
protoc-jar: executing: [/tmp/protocjar11922424117142267978/bin/protoc.exe, -I/tmp/protocjar144442318840920881/include, -I/home/darren/java-sdk/sdk-autogen/target/proto/dapr/proto/common/v1, --java_out=/home/darren/java-sdk/sdk-autogen/target/generated-sources, /home/darren/java-sdk/sdk-autogen/target/proto/dapr/proto/common/v1/common.proto]
/tmp/protocjar11922424117142267978/bin/protoc.exe: 1: cannot open !DOCTYPE: No such file
/tmp/protocjar11922424117142267978/bin/protoc.exe: 1: HTML: not found
/tmp/protocjar11922424117142267978/bin/protoc.exe: 2: cannot open html: No such file
/tmp/protocjar11922424117142267978/bin/protoc.exe: 3: Syntax error: redirection unexpected
[ERROR] /home/darren/java-sdk/sdk-autogen/target/proto/dapr/proto/common/v1/common.proto [0:0]: /tmp/protocjar11922424117142267978/bin/protoc.exe: 1: cannot open !DOCTYPE: No such file
[ERROR] /home/darren/java-sdk/sdk-autogen/target/proto/dapr/proto/common/v1/common.proto [0:0]: /tmp/protocjar11922424117142267978/bin/protoc.exe: 1: HTML: not found
[ERROR] /home/darren/java-sdk/sdk-autogen/target/proto/dapr/proto/common/v1/common.proto [0:0]: /tmp/protocjar11922424117142267978/bin/protoc.exe: 2: cannot open html: No such file
[ERROR] /home/darren/java-sdk/sdk-autogen/target/proto/dapr/proto/common/v1/common.proto [0:0]: /tmp/protocjar11922424117142267978/bin/protoc.exe: 3: Syntax error: redirection unexpected
[ERROR] /home/darren/java-sdk/sdk-autogen/target/proto/dapr/proto/common/v1/common.proto [0:0]:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for dapr-sdk-parent 1.0.0-SNAPSHOT:
[INFO]
[INFO] dapr-sdk-parent .................................... SUCCESS [  5.277 s]
[INFO] dapr-sdk-autogen ................................... FAILURE [  1.956 s]
[INFO] dapr-sdk ........................................... SKIPPED
[INFO] dapr-sdk-actors .................................... SKIPPED
[INFO] dapr-sdk-springboot ................................ SKIPPED
[INFO] dapr-sdk-examples .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.295 s
[INFO] Finished at: 2021-01-31T20:49:49+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.os72:protoc-jar-maven-plugin:3.11.4:run (default) on project dapr-sdk-autogen: protoc-jar failed for /home/darren/java-sdk/sdk-autogen/target/proto/dapr/proto/common/v1/common.proto. Exit code 2 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :dapr-sdk-autogen

I don't have a pure linux dev env, this is what I got building in WLS2 Ubuntu-20.04 distro. And this is the repo I used to build:

    <mirror>
      <id>repo1</id>
      <mirrorOf>central</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>https://repo1.maven.org/maven2/</url>
      <!--<url>http://insecure.repo1.maven.org/maven2/</url>-->
    </mirror>
    <mirror>
      <id>repo2</id>
      <mirrorOf>central</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>https://repo2.maven.org/maven2/</url>
    </mirror>
  </mirrors>

darren-wang avatar Jan 31 '21 12:01 darren-wang

They are different.

  • using protocVersion will lead to a manually download, mostly from default Central.
  • protocArtifact will using maven resolver to download protoc like other depdencies in pom.xml. So in case your project using private maven repository, protocArtifact will help to resolve the issue.

hieutruong-sym avatar Apr 16 '22 07:04 hieutruong-sym