macOS grpc自動生成java代碼問題

遇到了macOS grpc自動生成java代碼問題

系統(tǒng)版本: macOS catalina 10.15
IDEA: 2019.1.3 社區(qū)版本

使用的protoc 的方式時,只能生成domain類,不能生成service類,需要使用protoc-gen-grpc-java的插件,各種需要自己編譯,故使用https://github.com/grpc/grpc-java/blob/master/README.md描述的 Generated Code里面的方法。但是仍然無法生成grpc-java的代碼,還是只有domain類,和使用widows系統(tǒng)同時比對,缺少如圖1的標(biāo)紅的插件

image

繼續(xù)看官方文檔 發(fā)現(xiàn)如下描述(Eclipse and NetBeans users should also look at os-maven-plugin's IDE documentation進(jìn)入鏈接https://github.com/trustin/os-maven-plugin#issues-with-eclipse-m2e-or-other-ides果斷設(shè)置了maven的setting.xml。

另外注意需要執(zhí)行兩次 maven:protobuf:compile

如圖
protobuf.compile.png
    <profiles>
        <profile>
            <id>os-properties</id>
            <properties>
                <os.detected.name>osx</os.detected.name>
                <os.detected.arch>x86_64</os.detected.arch>
                <os.detected.classifier>osx-x86_64</os.detected.classifier>
            </properties>
        </profile>

  <activeProfiles>
    <activeProfile>apus nexus</activeProfile>
    <activeProfile>os-properties</activeProfile>
  </activeProfiles>

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容