power
power

Reputation: 53

run task with maven after specific phace

how run a task post maven eclipse:eclipse phase ?

<groupId>org.codehaus.mojo</groupId>

<artifactId>exec-maven-plugin</artifactId>

<version>1.2</version>

<executions>

    <execution>

        <phase>eclipse:eclipse</phase>

        <goals>

            <goal>java</goal>

        </goals>

        <configuration>

            <executable>java</executable>

            <mainClass>a.b.c.Main</mainClass>

        </configuration>

    </execution>

</executions>

this configuration seems not ok.

Upvotes: 1

Views: 251

Answers (1)

Pascal Thivent
Pascal Thivent

Reputation: 570595

how run a task post maven eclipse:eclipse phase ?

You can't, eclipse:eclipse is not a phase.

Either bind some goals on the same phase (if this even makes sense) and they would get executed in their declaration order.

Or invoke them from the command line (and optionally provide a default configuration to be used when running from the command line). For example, you could do:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>exec-maven-plugin</artifactId>
  <version>1.2</version>
  <executions>
    <execution>
      <id>default-cli</phase>
      <configuration>
        <executable>java</executable>
        <mainClass>a.b.c.Main</mainClass>
      </configuration>
    </execution>
  </executions>
</plugin>

And then invoke:

mvn eclipse:eclipse exec:java

Upvotes: 2

Related Questions