maven 实现pb的实时编译


<properties> <protobuf.version>3.15.7</protobuf.version>
</properties>

 

 

<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.4.1.Final</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.0</version>
<extensions>true</extensions>
<configuration>
<protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}
</protocArtifact>
<attachProtoSources>false</attachProtoSources>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>

 

 

proto 放到 src/main/proto 即可.

 

posted @ 2021-10-27 21:45  阿旭^_^  阅读(170)  评论(0编辑  收藏  举报