protoc custom plugin erroring out with Program not found or is not executable

半城伤御伤魂 提交于 2020-06-09 05:37:45

问题


I am trying to build a custom protoc plugin to generate custom output from .proto files. I literally copied java file containing CodeGenerator from protoc custom plugin as a starting point and renamed it. I also followed executable and created .sh file. The content of my shell script is as follows.

I also add the PATH variable value and output of the plugin execution. Can someone point me where I am going wrong with this? The shell script runs fine separately executing the main method


回答1:


how about using absolute path of example.sh? protoc working directory may not be current folder.




回答2:


If that is your entire example.sh, it won't work because it doesn't have a "hashbang" line identifying the script interpreter.

It should be something like:

#!/bin/bash
set -e
java cp ...

I think that's likely your problem because I tried running protoc and specifying an plug-in in the same way you did, and it worked as long as the plug-in was actually executable on its own.



来源:https://stackoverflow.com/questions/62168625/protoc-custom-plugin-erroring-out-with-program-not-found-or-is-not-executable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!