Is there a way to get the current execution id of a goal at runtime from the mojo implementation?
I would like to use the execution id in the mojo code to avoid the need for an extra configuration parameter.
Here is an execution example:
<execution>
<id>spring</id>
<phase>generate-sources</phase>
<configuration>
<id>spring</id> <!-- duplicate.. -->
<apiPath>${project.basedir}/src/api/openapi.yaml</apiPath>
</configuration>
<goals>
<goal>process</goal>
</goals>
</execution>
Depending on the value of <id>
the process
mojo would run different code. I need the id to select the correct service (loaded with java.util.ServiceLoader
).
Not sure if reusing the id is a good idea but I would like to know if it is possible at all? :-)