I have a simple question about execution ID in maven plugin.
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.7.0</version>
<executions>
<execution>
<id>gwt-process-resources</id>
<goals>
<goal>i18n</goal>
<goal>generateAsync</goal>
</goals>
</execution>
</executions>
Can someone explain to me what does this executionId does? How are goals triggered? Can I call directly the "gwt-process-resources" in order to execute both goals? If yes, how can I do that?
An Execution Id is a valid user ID that is used to connect to the Reporting Server, FTP server or web server to run a schedule task. When an Execution Id is created, changed, or deleted on a server, it must also be created, changed, or deleted in the Repository table that stores Execution Id credentials.
Maven exec plugin allows us to execute system and Java programs from the maven command. There are two goals of the maven exec plugin: exec:exec - can be used to execute any program in a separate process. exec:java - can be used to run a Java program in the same VM.
The id element has two functions: Documentation. Allow Maven to know when you want to create a new execution and when you want to modify an existing one.
pluginManagement: is an element that is seen along side plugins. Plugin Management contains plugin elements in much the same way, except that rather than configuring plugin information for this particular project build, it is intended to configure project builds that inherit from this one.
<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:
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:
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With