【问题标题】:How to solve CreateProcess error=206, The filename or extension is too long error of maven-protobuf-plugin?如何解决maven-protobuf-plugin的CreateProcess error=206, The filename or extension is too long错误?
【发布时间】:2023-02-03 19:10:39
【问题描述】:

如何在构建使用 protobufs 的 Maven 项目时解决此错误?

org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:compile (default) on project my-module: An error occurred while invoking protoc: Error while executing process.: Cannot run program "cmd.exe": CreateProcess error=206, The filename or extension is too long

我使用 maven-protobuf-plugin 版本 0.6.1 。

我试过

  • -Didea.dynamic.classpath=true添加到mvn clean install
  • 命令添加"dynamic.classpath": "true"
  • IntelliJ 的 PropertiesComponent workspace.xml 从 Intellij 外部的终端安装更新版本的协议编译器构建

但没有一个奏效。

【问题讨论】:

    标签: maven kotlin protocol-buffers protoc


    【解决方案1】:

    要解决此问题,请在插件中设置 <useArgumentFile>true</useArgumentFile> 配置选项,如 here 下所述

    处理“命令行太长”错误

    它在 pom.xml 中应该如下所示:

    <plugin>
        <groupId>org.xolstice.maven.plugins</groupId>
        <artifactId>protobuf-maven-plugin</artifactId>
        <version>0.6.1</version>
        <configuration>                   
            <useArgumentFile>true</useArgumentFile>
        </configuration>
    

    【讨论】:

      猜你喜欢
      • 2015-06-28
      • 1970-01-01
      • 1970-01-01
      • 2020-07-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多