maven如何單獨啟動插件目標


  說來惱火,在網上找了半天沒找到

  原來插件名稱其實不需要定義而是直接想象到的,如下,我嘗試過了好幾種

  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沒有把插件名稱用元數據表示呢?


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM