2012-02-22 2 views
2

У меня есть следующий раздел, который я успешно выполняет («МВН Exec: EXEC -DrunMule»):«Exec-Maven-плагин» не выполняет

<profile> 
     <id>runMule</id> 
     <activation> 
      <property> 
       <name>runMule</name> 
      </property> 
     </activation> 
     <build> 
      <plugins> 
       <plugin> 
        <groupId>org.codehaus.mojo</groupId> 
        <artifactId>exec-maven-plugin</artifactId> 
        <version>1.2.1</version> 
        <configuration> 
         <executable>java</executable> 
         <arguments> 
          <argument>-classpath</argument> 
          <!-- automatically creates the classpath using all project dependencies, also adding the project build directory --> 
          <classpath/> 
          <argument>org.mule.MuleServer</argument> 
          <argument>-config</argument> 
          <argument>mule-config.xml</argument> 
         </arguments> 
        </configuration> 
       </plugin> 
      </plugins> 
     </build> 
    </profile> 

Я пытаюсь преобразовать его запустить в конкретный этап при выполнении Maven построить в пределах того же pom.xml:

<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> 

Этот новый плагин не выполняет, когда я выполняю «МВН чистой установки». Мне непонятно, почему это не так.

-------------- -------------- обновление

После того, как предложение было поставить конфигурацию внутри исполнения. Это то, что я пробовал, и он все еще не выполнялся.

<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> 
+0

Что произойдет, если вы запустите 'mvn validate'? –

+0

Ничего не происходит. – TERACytE

ответ

2

'конфигурация' должна быть под 'исполнение':

<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> 
+0

Это не сработало. Он все еще не работает. Я обновил вопрос, включив эту попытку. – TERACytE

1

плагин был определен под другим, гораздо больший профиль. Я думал, что добавляю его в общую сборку, когда я действительно не был. Я вытащил его из профиля, и он сработал. Урок выучен. Спасибо за ответы.