Protocol Buffers library-dependent location in IntelliJ

Solution 1:

I didn't get correctly what do you mean by library-dependent location - could you please explain?

As for protobuf plugin settings: there you can find all directories, where you'll be able to import files from. E.g. if the protobuf file is located in /foo/bar/MyService.proto, and you want to be able to import it as import "bar/MyService.proto";, you should add /foo/ directory to the plugin settings. In fact those settings mean exactly the same as directories one specifies with proto-path cli argument: if any proto file can not be resolved against one of given proto-paths, compilation will not succeed.

Also you may find useful the following issues about simplifying solving imports-related problems: https://youtrack.jetbrains.com/issue/IDEA-283099 and https://youtrack.jetbrains.com/issue/IDEA-283097