0

I have two maven plugins configured. One, the exec-maven-plugin, is bound to the compile phase. The other, maven-resources-plugin, is bound to the prepare-package phase. I need exec to run before resources, and I figured this should work because the compile phase comes before the prepare-package phase in the build life-cycle. I must be missing something.

Here are the two configurations:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.2.1</version>
    <executions>
        <execution>
            <id>build-tracker</id>
            <phase>compile</phase>
            <goals>
                <goal>exec</goal>
            </goals>
            <configuration>
                <!--Config here-->
            </configuration>
        </execution>
    </executions>
</plugin>

And:

<plugin>
    <artifactId>maven-resources-plugin</artifactId>
    <version>2.5</version>
    <executions>
        <execution>
            <id>copy-ftl</id>
            <phase>prepare-package</phase>
            <goals>
                <goal>copy-resources</goal>
            </goals>
            <configuration>
                <!--Config here-->
            </configuration>
        </execution>
    </executions>
</plugin>

Why are these executing out of order?

David
  • 14,569
  • 34
  • 78
  • 107
  • Apart from the fact that those 2 plugins are a bit outdated (but not much), the configuration looks fine. Could it be that you're getting confused with the default executions of those plugins, which are defined in the maven super pom? – Augusto Jun 15 '15 at 18:21
  • @Augusto, I didn't know there was such a thing. I'll take a look. Are the default executions relevant though since I've defined my own executions? Does the maven super-pom change the order these things run in? – David Jun 15 '15 at 18:23
  • @Augusto, having taken a look at the super pom, I don't see anything in there related to the resources or exec plugin. Have I missed something? Should I expect something in that pom to be affecting the execution order of these two plugins? – David Jun 15 '15 at 18:34
  • This is just a theory, but does the exec plugin execute asynchronously? – David Jun 15 '15 at 18:45
  • First post your full pom file otherwise it's hard to see what you are really doing. Apart from that why are you using exec-maven-plugin for compile phase? What are you going to accomplish? – khmarbaise Jun 15 '15 at 18:59

0 Answers0