Maven plugin execution ID

<id></id> exists only for you to be able to distinguish between other executions. This tag will be displayed when you do the actual build.

Your execution example will invoke the two goals you have specified: i18n and generateAsync.

If the plugin isn't bound to a specific phase (process-resources, package, install, etc) your execution will not performed. The plugin's documentation should tell if this is the case.

You can specify/override the default phase by using the <phase> tag:

...
<execution>
  <id>gwt-process-resources</id>
  <phase>process-resources</phase> <!-- If you need to override -->
  <goals>
    <goal>i18n</goal>
    <goal>generateAsync</goal>
  </goals>
</execution>
...

...

Goals are either triggered:

  • Automatically (implicitly by their default phase or explicitly as above)
  • By command line execution: mvn <plugin name>:<goal>

Here is a very simple explanation:

You can not call excecution ids directly

  mvn gwt-process-resources

will not work since gwt-process-resources is just an id.

If there is no <phase> declaration in the pom then you might want to look at the documentation of the plugin and find the corresponding default phase. If you look at the documentation of the gwt plugin:

  • gwt:i18n Binds by default to generate-sources.
  • gwt:generateAsync Binds by default to the lifecycle phase: generate-sources.

How are goals triggered?

if you do

mvn compile

=> compile > generate-sources in maven lifecycle
=> maven execute gwt:i18n after gwt:generateAsync
=> executed in the order they are declared in pom.xml because they are bound to some phase "generate-sources"


Yes, since Maven 3.3.1 you can, but you need to explicitly execute each goal. There are a couple of ways.

This works always:

mvn <group-id>:<artifact-id>:(<version>):<goal>@<execution-id>

in your case:

mvn org.codehaus.mojo:gwt-maven-plugin:i18n@gwt-process-resources (you can skip the version)

The other (more convenient) way is by using the short name of the goals, as found at the top of the plugin page:

mvn gwt:i18n@gwt-process-resources

Tags:

Java

Maven

Gwt