Maven Plugin Launch ID

I have a simple question about runtime 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 this execId does? How are goals triggered? Can I directly call "gwt-process-resources" to accomplish both goals? If so, how can I do this?

+4
source share
3 answers

<id></id>exists only so that you can distinguish between other performances. This tag will be displayed during the actual build.

Your execution example will indicate two goals you specified: i18nand generateAsync.

(process-resources, package, install ..), . , .

/ <phase > :

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

...

:

  • ( )
  • : mvn <plugin name>:<goal>
+6
here is a very simple explanation

1. You cant do this mvn gwt-process-resources , (gwt-process-resources juste id)
if not <phase> declaration in pom (look documentation and find default)

if you look documentation :
https://gwt-maven-plugin.imtqy.com/gwt-maven-plugin/plugin-info.html
- gwt:i18n Binds by default to   generate-sources.
- gwt:generateAsync Binds by default to the lifecycle phase: generate-sources.

2. How are goals triggered?

if u 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  are some phase "generate-sources"
+2

Source: https://habr.com/ru/post/1612736/


All Articles