Pregunta

Tengo el siguiente perfil que estoy ejecutando con éxito ("MVN exec: exec -drunmule"):

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

Estoy tratando de convertirlo para que se ejecute en una etapa específica cuando realice una construcción de Maven dentro del mismo 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>

Este nuevo complemento no se ejecuta cuando realizo una "instalación MVN Clean". No está claro para mí por qué no lo haría.

-------------- actualizar --------------

Una vez, la sugerencia fue poner la configuración dentro de la ejecución. Esto es lo que probé y todavía no se ejecutó.

<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>
¿Fue útil?

Solución

'Configuración' debería estar en 'Ejecución':

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

Otros consejos

El complemento se definió bajo otro perfil mucho más grande. Pensé que lo estaba agregando a la construcción general cuando realmente no. Lo sacé del perfil y funcionó. Lección aprendida. Gracias por las respuestas.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top