&引用;exec maven插件";不执行

&引用;exec maven插件";不执行,maven,mule,exec-maven-plugin,Maven,Mule,Exec Maven Plugin,我已成功执行以下配置文件(“mvn exec:exec-DrunMule”): 伦穆尔 伦穆尔 org.codehaus.mojo execmaven插件 1.2.1 JAVA -类路径 org.mule.MuleServer -配置 mule-config.xml 在同一pom.xml中执行maven构建时,我尝试将其转换为在特定阶段运行: <plugin> <groupId>org.codehaus.mojo</groupId> <

我已成功执行以下配置文件(“mvn exec:exec-DrunMule”):


伦穆尔
伦穆尔
org.codehaus.mojo
execmaven插件
1.2.1
JAVA
-类路径
org.mule.MuleServer
-配置
mule-config.xml
在同一pom.xml中执行maven构建时,我尝试将其转换为在特定阶段运行:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.2.1</version>
    <executions>
        <execution>
            <phase>validate</phase>
            <goals>
                <goal>java</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <mainClass>org.mule.MuleServer</mainClass>
        <arguments>
            <argument>-classpath</argument>
            <classpath/>
            <argument>-config</argument>
            <argument>mule-config.xml</argument>
        </arguments>
    </configuration>

org.codehaus.mojo
execmaven插件
1.2.1
验证
JAVA
org.mule.MuleServer
-类路径
-配置
mule-config.xml

当我执行“mvn干净安装”时,这个新插件不会执行。我不清楚为什么它不会

--------------更新--------------

曾经有人建议将配置放在执行中。这是我尝试过的,但仍然没有执行

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <executions>
        <execution>
            <phase>validate</phase>
            <goals>
                <goal>exec</goal>
            </goals>
            <configuration>
                <executable>java</executable>
                <arguments>
                    <argument>-classpath</argument>
                    <classpath/>
                    <argument>org.mule.MuleServer</argument>
                    <argument>-config</argument>
                    <argument>mule-config.xml</argument>
                </arguments>
            </configuration>
        </execution>
    </executions>
</plugin>

org.codehaus.mojo
execmaven插件
验证
执行官
JAVA
-类路径
org.mule.MuleServer
-配置
mule-config.xml

“配置”应在“执行”下:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <executions>
      <execution>
        <phase>validate</phase>
        <goals>
          <goal>exec</goal>
        </goals>
        <configuration>
           <executable>echo</executable>
           <arguments>
              <argument>"test"</argument>
           </arguments>
        </configuration>
      </execution>
    </executions>
  </plugin>

org.codehaus.mojo
execmaven插件
验证
执行官
回声
“测试”

插件是在另一个更大的配置文件下定义的。我以为我是在将它添加到通用构建中,而实际上我不是。我把它移出了个人资料,它成功了。吸取的教训。感谢您的回复。

这不起作用。它仍然没有运行。我更新了问题以包含尝试。如果运行
mvn validate
,会发生什么情况?
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <executions>
      <execution>
        <phase>validate</phase>
        <goals>
          <goal>exec</goal>
        </goals>
        <configuration>
           <executable>echo</executable>
           <arguments>
              <argument>"test"</argument>
           </arguments>
        </configuration>
      </execution>
    </executions>
  </plugin>