ScalaBuff在解析protobuf文件时出现错误

时间:2019-01-04 18:44:43

标签: java scala protocol-buffers

我收到以下错误:

[INFO] --- exec-maven-plugin:1.2.1:exec (protobuf-sources) @ structure-idl ---
<unknown>:1:1: string matching regex `\z' expected but `s' found
syntax = "proto3";

存在下面的依赖关系,我想要实现的是从protobuf文件生成Scala和Java文件

<plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.7</version>
        <executions>
            <execution>
                <phase>initialize</phase>
                <configuration>
                    <tasks>
                        <mkdir dir="target/generated-sources/scalabuff" />
                    </tasks>
                </configuration>
                <goals>
                    <goal>run</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.2.1</version>
        <executions>
            <execution>
                <id>protobuf-sources</id>
                <phase>generate-sources</phase>
                <goals>
                    <goal>exec</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <executable>java</executable>
            <arguments>
                <argument>-classpath</argument>
                <!-- automatically creates the classpath using all project dependencies,
                 also adding the project build directory -->
                <classpath/>
                <argument>net.sandrogrzicic.scalabuff.compiler.ScalaBuff</argument>
                <argument>--proto_path=src/main/protobuf</argument>
                <argument>--scala_out=target/generated-sources/scalabuff</argument>
            </arguments>
            <sourceRoot>target/generated-sources/scalabuff</sourceRoot>
        </configuration>
   </plugin>

0 个答案:

没有答案