說來惱火,在網上找了半天沒找到
原來插件名稱其實不需要定義而是直接想象到的,如下,我嘗試過了好幾種
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沒有把插件名稱用元數據表示呢?