Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting insertion point scope-related errors on windows #4

Closed
sachins-dev opened this issue Feb 12, 2022 · 9 comments
Closed

Getting insertion point scope-related errors on windows #4

sachins-dev opened this issue Feb 12, 2022 · 9 comments

Comments

@sachins-dev
Copy link

sachins-dev commented Feb 12, 2022

Getting insertion point scope-related errors when using [protoc-gen-java-optional] on windows.
However, the same project is getting compiled successfully on macOS.

Maven logs on windows.

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: windows
[INFO] os.detected.arch: x86_64
[INFO] os.detected.bitness: 64
[INFO] os.detected.version: 10.0
[INFO] os.detected.version.major: 10
[INFO] os.detected.version.minor: 0
[INFO] os.detected.classifier: windows-x86_64
[INFO]
[INFO] ----------------< com.sachin.protobuf.grpc:grpc-schema >----------------
[INFO] Building grpc-schema 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- protobuf-maven-plugin:0.6.1:compile (protobuf) @ grpc-schema ---
[INFO] Building protoc plugin: java-optional
[INFO] Compiling 4 proto file(s) to D:\WorkSpaces\Projects\IntelliJ\Protobuf-IDL\Grpc-Schema\target\generated-sources\protobuf\java
[ERROR] PROTOC FAILED: com\sachin\protobuf\connection\ConnectionRequest.java: Tried to insert into file that doesn't exist.
com\sachin\protobuf\connection\ConnectionRequest.java: insertion point "class_scope:protos.ConnectionRequest" not found.
com\sachin\protobuf\datatype\TestMessage.java: Tried to insert into file that doesn't exist.
com\sachin\protobuf\datatype\TestMessage.java: insertion point "class_scope:protos.TestMessage" not found.
com\sachin\protobuf\datatype\TestMessage.java: insertion point "builder_scope:protos.TestMessage.NestedTestMessage" not found.
com\sachin\protobuf\datatype\TestMessage.java: insertion point "class_scope:protos.TestMessage.NestedTestMessage" not found.
com\sachin\protobuf\datatype\TestMessage.java: insertion point "builder_scope:protos.TestMessage.NestedTestMessage.DeepNestedTestMessage" not found.
com\sachin\protobuf\datatype\TestMessage.java: insertion point "class_scope:protos.TestMessage.NestedTestMessage.DeepNestedTestMessage" not found.

[ERROR] D:\WorkSpaces\Projects\IntelliJ\Protobuf-IDL\Grpc-Schema\src\main\resources\protos\connection-metadata.proto [0:0]: com\sachin\protobuf\connection\ConnectionRequest.java: Tried to insert into file that doesn't exist.
com\sachin\protobuf\connection\ConnectionRequest.java: insertion point "class_scope:protos.ConnectionRequest" not found.
com\sachin\protobuf\datatype\TestMessage.java: Tried to insert into file that doesn't exist.
com\sachin\protobuf\datatype\TestMessage.java: insertion point "class_scope:protos.TestMessage" not found.
com\sachin\protobuf\datatype\TestMessage.java: insertion point "builder_scope:protos.TestMessage.NestedTestMessage" not found.
com\sachin\protobuf\datatype\TestMessage.java: insertion point "class_scope:protos.TestMessage.NestedTestMessage" not found.
com\sachin\protobuf\datatype\TestMessage.java: insertion point "builder_scope:protos.TestMessage.NestedTestMessage.DeepNestedTestMessage" not found.
com\sachin\protobuf\datatype\TestMessage.java: insertion point "class_scope:protos.TestMessage.NestedTestMessage.DeepNestedTestMessage" not found.

[ERROR] D:\WorkSpaces\Projects\IntelliJ\Protobuf-IDL\Grpc-Schema\src\main\resources\protos\data-types.proto [0:0]: com\sachin\protobuf\connection\ConnectionRequest.java: Tried to insert into file that doesn't exist.
com\sachin\protobuf\connection\ConnectionRequest.java: insertion point "class_scope:protos.ConnectionRequest" not found.
com\sachin\protobuf\datatype\TestMessage.java: Tried to insert into file that doesn't exist.
com\sachin\protobuf\datatype\TestMessage.java: insertion point "class_scope:protos.TestMessage" not found.
com\sachin\protobuf\datatype\TestMessage.java: insertion point "builder_scope:protos.TestMessage.NestedTestMessage" not found.
com\sachin\protobuf\datatype\TestMessage.java: insertion point "class_scope:protos.TestMessage.NestedTestMessage" not found.
com\sachin\protobuf\datatype\TestMessage.java: insertion point "builder_scope:protos.TestMessage.NestedTestMessage.DeepNestedTestMessage" not found.
com\sachin\protobuf\datatype\TestMessage.java: insertion point "class_scope:protos.TestMessage.NestedTestMessage.DeepNestedTestMessage" not found.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.498 s
[INFO] Finished at: 2022-02-12T13:08:00+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:compile (protobuf) on project grpc-schema: protoc did not exit cleanly. Review output for more information. -> [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/MojoFailureException

Process finished with exit code 1

Below is the build section of pom.xml

<build>
    <extensions>
        <extension>
            <groupId>kr.motd.maven</groupId>
            <artifactId>os-maven-plugin</artifactId>
            <version>1.7.0</version>
        </extension>
    </extensions>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>17</source>
                <target>17</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.xolstice.maven.plugins</groupId>
            <artifactId>protobuf-maven-plugin</artifactId>
            <version>0.6.1</version>
            <executions>
                <execution>
                    <id>protobuf</id>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                    <phase>generate-sources</phase>
                    <configuration>
                        <protocArtifact>
                            com.google.protobuf:protoc:3.19.4:exe:${os.detected.classifier}
                        </protocArtifact>
                        <protoSourceRoot>${basedir}/src/main/resources/protos/</protoSourceRoot>
                        <useArgumentFile>true</useArgumentFile>
                        <clearOutputDirectory>true</clearOutputDirectory>
                        <protocPlugins>
                            <protocPlugin>
                                <id>java-optional</id>
                                <groupId>org.grpcmock</groupId>
                                <artifactId>protoc-gen-java-optional</artifactId>
                                <version>1.7.0</version>
                                <mainClass>org.grpcmock.protoc.plugin.OptionalGenerator</mainClass>
                            </protocPlugin>
                        </protocPlugins>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
@Fadelis
Copy link
Owner

Fadelis commented Feb 12, 2022

Hi @sachin-development , sadly I don't use windows so I cannot test it. The path separator seems ok for windows though. Are you using git-bash on windows or smth else, maybe you could try it with it?
Also maybe you could share your target/generated-sources folder structure without using this plugin and some of your proto files?

@sachins-dev
Copy link
Author

sachins-dev commented Feb 12, 2022

Hi @Fadelis , Thanks for the quick response. I have tried to compile this project using windows command prompt, git-bash as well as IntelliJ idea as well on windows, but the result is the same on both. I am sharing the project structure.

image

@Fadelis
Copy link
Owner

Fadelis commented Feb 12, 2022

I've releases a new version 1.8.0 that should fix this issue. Give it a few hours for the artefacts to propagate to maven central and try again with the new version

@sachins-dev
Copy link
Author

I've releases a new version 1.8.0 that should fix this issue. Give it a few hours for the artefacts to propagate to maven central and try again with the new version

Thanks a lot @Fadelis, will check and let you know, once the artifact is available on maven central.

@sachins-dev
Copy link
Author

I've releases a new version 1.8.0 that should fix this issue. Give it a few hours for the artefacts to propagate to maven central and try again with the new version

Thanks a lot @Fadelis, will check and let you know, once the artifact is available on maven central.

Hi @Fadelis, I have tried with the updated version, the previous error is gone but now I am getting the below error.
Please help.

image

image

Maven logs
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: windows
[INFO] os.detected.arch: x86_64
[INFO] os.detected.bitness: 64
[INFO] os.detected.version: 10.0
[INFO] os.detected.version.major: 10
[INFO] os.detected.version.minor: 0
[INFO] os.detected.classifier: windows-x86_64
[INFO]
[INFO] ----------------< com.sachin.protobuf.grpc:grpc-schema >----------------
[INFO] Building grpc-schema 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- protobuf-maven-plugin:0.6.1:compile (protobuf) @ grpc-schema ---
[INFO] Building protoc plugin: java-optional
[INFO] Compiling 4 proto file(s) to D:\WorkSpaces\Projects\IntelliJ\Protobuf-IDL\Grpc-Schema\target\generated-sources\protobuf\java
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ grpc-schema ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ grpc-schema ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 20 source files to D:\WorkSpaces\Projects\IntelliJ\Protobuf-IDL\Grpc-Schema\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/connection/ConnectionResponse.java:[168,48] cannot find symbol
symbol: method isStringEmpty(java.lang.Object)
location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/connection/ConnectionResponse.java:[183,48] cannot find symbol
symbol: method isStringEmpty(java.lang.Object)
location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/payloads/SimpleRequest.java:[142,48] cannot find symbol
symbol: method isStringEmpty(java.lang.Object)
location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/payloads/SimpleRequest.java:[154,48] cannot find symbol
symbol: method isStringEmpty(java.lang.Object)
location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/payloads/SimpleResponse.java:[142,48] cannot find symbol
symbol: method isStringEmpty(java.lang.Object)
location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/payloads/SimpleResponse.java:[154,48] cannot find symbol
symbol: method isStringEmpty(java.lang.Object)
location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/connection/ConnectionRequest.java:[242,48] cannot find symbol
symbol: method isStringEmpty(java.lang.Object)
location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/connection/ConnectionRequest.java:[245,48] cannot find symbol
symbol: method isStringEmpty(java.lang.Object)
location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/connection/ConnectionRequest.java:[260,48] cannot find symbol
symbol: method isStringEmpty(java.lang.Object)
location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/connection/ConnectionRequest.java:[263,48] cannot find symbol
symbol: method isStringEmpty(java.lang.Object)
location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/datatype/TestSubMessage.java:[142,48] cannot find symbol
symbol: method isStringEmpty(java.lang.Object)
location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/datatype/TestSubMessage.java:[154,48] cannot find symbol
symbol: method isStringEmpty(java.lang.Object)
location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/datatype/TestMessage.java:[842,52] cannot find symbol
symbol: method isStringEmpty(java.lang.Object)
location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/datatype/TestMessage.java:[860,52] cannot find symbol
symbol: method isStringEmpty(java.lang.Object)
location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/datatype/TestMessage.java:[1695,50] cannot find symbol
symbol: method isStringEmpty(java.lang.Object)
location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/datatype/TestMessage.java:[1713,50] cannot find symbol
symbol: method isStringEmpty(java.lang.Object)
location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/datatype/TestMessage.java:[3261,48] cannot find symbol
symbol: method isStringEmpty(java.lang.Object)
location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/datatype/TestMessage.java:[3369,48] cannot find symbol
symbol: method isStringEmpty(java.lang.Object)
location: class com.google.protobuf.GeneratedMessageV3
[INFO] 18 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.330 s
[INFO] Finished at: 2022-02-12T23:44:14+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project grpc-schema: Compilation failure: Compilation failure:
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/connection/ConnectionResponse.java:[168,48] cannot find symbol
[ERROR] symbol: method isStringEmpty(java.lang.Object)
[ERROR] location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/connection/ConnectionResponse.java:[183,48] cannot find symbol
[ERROR] symbol: method isStringEmpty(java.lang.Object)
[ERROR] location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/payloads/SimpleRequest.java:[142,48] cannot find symbol
[ERROR] symbol: method isStringEmpty(java.lang.Object)
[ERROR] location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/payloads/SimpleRequest.java:[154,48] cannot find symbol
[ERROR] symbol: method isStringEmpty(java.lang.Object)
[ERROR] location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/payloads/SimpleResponse.java:[142,48] cannot find symbol
[ERROR] symbol: method isStringEmpty(java.lang.Object)
[ERROR] location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/payloads/SimpleResponse.java:[154,48] cannot find symbol
[ERROR] symbol: method isStringEmpty(java.lang.Object)
[ERROR] location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/connection/ConnectionRequest.java:[242,48] cannot find symbol
[ERROR] symbol: method isStringEmpty(java.lang.Object)
[ERROR] location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/connection/ConnectionRequest.java:[245,48] cannot find symbol
[ERROR] symbol: method isStringEmpty(java.lang.Object)
[ERROR] location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/connection/ConnectionRequest.java:[260,48] cannot find symbol
[ERROR] symbol: method isStringEmpty(java.lang.Object)
[ERROR] location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/connection/ConnectionRequest.java:[263,48] cannot find symbol
[ERROR] symbol: method isStringEmpty(java.lang.Object)
[ERROR] location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/datatype/TestSubMessage.java:[142,48] cannot find symbol
[ERROR] symbol: method isStringEmpty(java.lang.Object)
[ERROR] location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/datatype/TestSubMessage.java:[154,48] cannot find symbol
[ERROR] symbol: method isStringEmpty(java.lang.Object)
[ERROR] location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/datatype/TestMessage.java:[842,52] cannot find symbol
[ERROR] symbol: method isStringEmpty(java.lang.Object)
[ERROR] location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/datatype/TestMessage.java:[860,52] cannot find symbol
[ERROR] symbol: method isStringEmpty(java.lang.Object)
[ERROR] location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/datatype/TestMessage.java:[1695,50] cannot find symbol
[ERROR] symbol: method isStringEmpty(java.lang.Object)
[ERROR] location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/datatype/TestMessage.java:[1713,50] cannot find symbol
[ERROR] symbol: method isStringEmpty(java.lang.Object)
[ERROR] location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/datatype/TestMessage.java:[3261,48] cannot find symbol
[ERROR] symbol: method isStringEmpty(java.lang.Object)
[ERROR] location: class com.google.protobuf.GeneratedMessageV3
[ERROR] /D:/WorkSpaces/Projects/IntelliJ/Protobuf-IDL/Grpc-Schema/target/generated-sources/protobuf/java/com/sachin/protobuf/datatype/TestMessage.java:[3369,48] cannot find symbol
[ERROR] symbol: method isStringEmpty(java.lang.Object)
[ERROR] location: class com.google.protobuf.GeneratedMessageV3
[ERROR] -> [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/MojoFailureException

Process finished with exit code 1

@Fadelis
Copy link
Owner

Fadelis commented Feb 12, 2022

@sachin-development this is not related to this module, this is related to your protoc/protobuf-java/grpc-java versions used. See protocolbuffers/protobuf#9236

@sachins-dev
Copy link
Author

sachins-dev commented Feb 12, 2022

@sachin-development this is not related to this module, this is related to your protoc/protobuf-java/grpc-java versions used. See protocolbuffers/protobuf#9236

@Fadelis, Thanks for the help, will try to figure it out. Although I am using the latest versions of the dependencies.
Below is the effective pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.sachin.protobuf.grpc</groupId>
  <artifactId>grpc-schema</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>grpc-schema</name>

  <properties>
    <java.version>17</java.version>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.grpcmock</groupId>
      <artifactId>protoc-gen-java-optional</artifactId>
      <version>1.8.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>javax.annotation</groupId>
      <artifactId>javax.annotation-api</artifactId>
      <version>1.3.2</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.tomcat</groupId>
      <artifactId>tomcat-annotations-api</artifactId>
      <version>10.1.0-M5</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
      <version>3.19.4</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java-util</artifactId>
      <version>3.19.4</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.googlecode.protobuf-java-format</groupId>
      <artifactId>protobuf-java-format</artifactId>
      <version>1.4</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
<build>
    <extensions>
        <extension>
            <groupId>kr.motd.maven</groupId>
            <artifactId>os-maven-plugin</artifactId>
            <version>1.7.0</version>
        </extension>
    </extensions>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>17</source>
                <target>17</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.xolstice.maven.plugins</groupId>
            <artifactId>protobuf-maven-plugin</artifactId>
            <version>0.6.1</version>
            <executions>
                <execution>
                    <id>protobuf</id>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                    <phase>generate-sources</phase>
                    <configuration>
                        <protocArtifact>
                            com.google.protobuf:protoc:3.19.4:exe:${os.detected.classifier}
                        </protocArtifact>
                        <protoSourceRoot>${basedir}/src/main/resources/protos/</protoSourceRoot>
                        <useArgumentFile>true</useArgumentFile>
                        <clearOutputDirectory>true</clearOutputDirectory>
                        <protocPlugins>
                            <protocPlugin>
                                <id>java-optional</id>
                                <groupId>org.grpcmock</groupId>
                                <artifactId>protoc-gen-java-optional</artifactId>
                                <version>1.8.0</version>
                                <mainClass>org.grpcmock.protoc.plugin.OptionalGenerator</mainClass>
                            </protocPlugin>
                        </protocPlugins>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
</project>

@Fadelis
Copy link
Owner

Fadelis commented Feb 12, 2022

@sachin-development you don't need protoc-gen-java-optional as a dependency, it's only needed in the build

@sachins-dev
Copy link
Author

@sachin-development you don't need protoc-gen-java-optional as a dependency, it's only needed in the build

Thanks @Fadelis, Yes you are right, removing "protoc-jar-maven-plugin" dependency solved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants