protoc jar maven插件intellij没有创建编译的proto文件

时间:2016-12-24 03:34:16

标签: maven intellij-idea protocol-buffers protoc

我正在尝试使用intelij中的protoc jar maven plugin。我已将此添加到我的pom.xml中:

        <plugin>
            <groupId>com.github.os72</groupId>
            <artifactId>protoc-jar-maven-plugin</artifactId>
            <version>3.1.0.2</version>
            <executions>
                <execution>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <includeDirectories>
                            <include>src/main/protobuf</include>
                        </includeDirectories>
                        <inputDirectories>
                            <include>src/main/protobuf</include>
                        </inputDirectories>
                    </configuration>
                </execution>
            </executions>
        </plugin>

我有一个位于src/main/protobuf的原型文件。我的pom.xml中也有这个:

    <dependency>
        <groupId>com.github.os72</groupId>
        <artifactId>protoc-jar</artifactId>
        <version>3.1.0.1</version>
    </dependency>

这是原型:

package stringtest;

message StringObject {
    repeated string string_one = 1;
    repeated string string_two = 2;
    repeated string string_three = 3;
}

但是,每当我右键单击我的模块并单击构建,或者如果我转到Build菜单并点击Build项目,我都看不到生成的任何已编译的protobuf文件。我也没有看到任何错误。有谁知道我做错了什么?

0 个答案:

没有答案
相关问题