-
Notifications
You must be signed in to change notification settings - Fork 3
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
Comments
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 |
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. |
I've releases a 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. Maven logs Process finished with exit code 1 |
@sachin-development this is not related to this module, this is related to your |
@Fadelis, Thanks for the help, will try to figure it out. Although I am using the latest versions of the dependencies. <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> |
@sachin-development you don't need |
Thanks @Fadelis, Yes you are right, removing "protoc-jar-maven-plugin" dependency solved the issue. |
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
The text was updated successfully, but these errors were encountered: