【问题标题】:Executing exec-maven-plugin not part of normal build process, and without inheritance执行 exec-maven-plugin 不是正常构建过程的一部分,并且没有继承
【发布时间】:2020-09-02 08:49:47
【问题描述】:

我正在尝试在正常构建过程之外执行一个 maven 插件,这是因为它应该作为 jenkins 作业的一部分仅在合并到 master 时执行。这是在 jenkins 文件中处理的。但是,为确保这一点,不需要通过运行 mvn clean install 来触发该插件。我现在的做法是将此插件放入 pluginManagement 中,当我希望运行插件时,我会调用 mvn exec:exec@goal。

这个插件只能在父级运行一次。我已将继承设置为 false,但构建仍然失败并显示此错误消息

The parameter 'executable' is missing or invalid

在父级成功执行后。 这是我的插件当前的配置方式:

<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>3.0.0</version>
           <inherited>false</inherited>
        <configuration>
           <param>${VID}</param>
           <param>${VKEY}</param>
           <param>${BUILD_NUMBER}</param>
           <executable>java</executable>
        </configuration>
           <executions>
              <execution>
                 <id>veracode</id>
                 <configuration>
                    <arguments>
                       <argument>-jar</argument>
                       <argument>${settings.localRepository}/com/veracode/vosp/api/wrappers/vosp-api-wrappers-java/20.7.7.0/vosp-api-wrappers-java-20.7.7.0.jar</argument>
                       <argument>-action</argument>
                       <argument>UploadAndScan</argument>
                       <argument>-vid</argument>
                       <argument>${VID}</argument>
                       <argument>-vkey</argument>
                       <argument>${VKEY}</argument>
                       <argument>-criticality</argument>
                       <argument>High</argument>
                       <argument>-createprofile</argument>
                       <argument>false</argument>
                       <argument>-createprofile</argument>
                       <argument>false</argument>
                       <argument>-version</argument>
                       <argument>${BUILD_NUMBER}</argument>
                       <argument>-appname</argument>
                       <argument>PULSE-DELIVERY</argument>
                       <argument>-sandboxname</argument>
                       <argument>proxy-standard</argument>
                       <argument>-filepath</argument>
                       <argument>proxy-service/target/lib</argument>
                    </arguments>
                    <classpathScope>run</classpathScope>
                    <includePluginDependencies>true</includePluginDependencies>
                 </configuration>
                 <goals>
                    <goal>exec</goal>
                 </goals>
              </execution>
           </executions>
        <dependencies>
           <dependency>
              <groupId>com.veracode.vosp.api.wrappers</groupId>
              <artifactId>vosp-api-wrappers-java</artifactId>
              <version>20.7.7.0</version>
           </dependency>
        </dependencies>
     </plugin>

【问题讨论】:

    标签: java maven build maven-3 maven-plugin


    【解决方案1】:

    我通过在所有子 pom 中将 skip 参数设置为 strue 解决了这个问题。

    description of skip

    【讨论】:

      猜你喜欢
      • 2013-05-30
      • 2012-03-13
      • 1970-01-01
      • 2014-04-23
      • 2015-03-04
      • 2014-04-19
      • 2011-01-12
      • 2010-11-28
      • 1970-01-01
      相关资源
      最近更新 更多