maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Podgursky <bpodgur...@gmail.com>
Subject Re: plugin execution & phase/goal selection question
Date Tue, 24 Jun 2014 04:17:48 GMT
Your goal would just be the goal from the antrun plugin that you want to
execute (in this case "run").  If you look at the list of lifecycle phases (
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html),
you could bind your execution to whichever phase makes most sense (say,
process-resources).  So working with the example from the antrun usage (
http://maven.apache.org/plugins/maven-antrun-plugin/usage.html), you'd get
something like:

      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.7</version>
        <executions>
          <execution>
            <phase> process-sources </phase>
            <configuration>
              <target>
                <!--
                  your ant code
                -->
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

so you're telling maven, run the "run" goal with this ant code during phase
process-sources.



On Mon, Jun 23, 2014 at 1:09 PM, kathyczv <kathyczv@gmail.com> wrote:

> I have a POM with packaging set to 'war'.
> I want to run 'antrun' plugin just before the code is compiled. What do I
> set the plugin's phase and goal to?
>
>
> My understanding is that the phase is one of the war's phases, for example:
> 'process-resources'
> Or a default one, for example: 'initialize'
>
> How about the goal, is that one of the antrun's goals?
>
> Your help is appreciated!
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message