最后我用这样的:
<plugin>
<groupId>com.google.protobuf.tools</groupId>
<artifactId>maven-protoc-plugin</artifactId>
<version>0.1.11-SNAPSHOT</version>
<configuration>
<protocExecutable>protoc</protocExecutable>
<protoSourceRoot>${project.basedir}/target/protobuff/speed</protoSourceRoot>
<languageSpecifications>
<LanguageSpecification>
<language>JAVA</language>
<outputDirectory>${project.basedir}/target/generated-sources/java</outputDirectory>
</LanguageSpecification>
<LanguageSpecification>
<language>CPP</language>
<outputDirectory>${project.basedir}/target/generated-sources/cpp</outputDirectory>
</LanguageSpecification>
</languageSpecifications>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
你找到一个答案?我试图让你的maven protoc插件使用语言规范,但它不会接受pom.xml文件中的' JAVA '。 –
我用我用来让它工作的pom文件部分更新了这个问题。 –
请提供您的解决方案作为答案。 – pjanssen