说来恼火,在网上找了半天没找到
原来插件名称其实不需要定义而是直接想象到的,如下,我尝试过了好几种
mvn plugin:goal 都没成功;从代码看goal已经没啥疑问了,就是compile,但哪个是plugin呢?
protobuf
protobuf
protobuf
protobuf
<plugins>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.1</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:3.5.1-1:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.11.0:exe:${os.detected.classifier}</pluginArtifact>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>compile-custom</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
所以只需要执行 mvn protobuf : compile 就行了
但为什么maven没有把插件名称用元数据表示呢?