jvolkman / intellij-protobuf-editor

Protocol Buffers for IntelliJ-based IDEs
Apache License 2.0
122 stars 15 forks source link

Cannot resolve import 'some.proto' #35

Closed greenn-lab closed 4 years ago

greenn-lab commented 4 years ago

Hi~ First, thank you for your plugin.

but, i met some problem. It's "import" phase.

I composed it like this. image

and used to "import" like this

// chaser.proto
syntax = "proto3";
option java_multiple_files = true;

/// some code

import "rian/apmax/commons.proto";

/// and continue...

Cannot resolve import 'rian/apmax/commons.proto' it's my problem.

And append build script by maven.

<!-- pom.xml -->
  <build>
    <extensions>
      <extension>
        <groupId>kr.motd.maven</groupId>
        <artifactId>os-maven-plugin</artifactId>
        <version>1.6.2</version>
      </extension>
    </extensions>
    <plugins>
      <plugin>
        <groupId>org.xolstice.maven.plugins</groupId>
        <artifactId>protobuf-maven-plugin</artifactId>
        <version>0.5.1</version>
        <configuration>
          <protocArtifact>com.google.protobuf:protoc:3.13.0:exe:${os.detected.classifier}</protocArtifact>
          <pluginId>grpc-java</pluginId>
          <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.31.1:exe:${os.detected.classifier}</pluginArtifact>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>compile-custom</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

I don't know about that. Thank for read my issue. bye~

greenn-lab commented 4 years ago

I resolved. It's so simple. image i made proto directory the Source root(or Resource Root). In summary, i included it in the classpath. 😭