Hi,
My issue is the following:
I would like to execute multiple MojoExecutions in the way that one of them sets a mavenProject property and the other reads it.
There are several examples to this with existing Mojos. E.g.:
- maven-scr-plugin sets a maven project property while maven-bundle-plugin reads it
- buildnumber-maven-plugin sets maven project property that is used during manifest generation by other mojo
The issue is that there is no function where I can run multiple mojoExecutions and they use the share the same mavenProject. Every call goes through the following function:
.......execute( session, execution, monitor)
This persists the project state and then restores it. So multiple mojos cannot share the same project properties.
Do you know a workaround? I can imagine only one with the current API but it is pretty ugly:
- I develop a CallbackMojo. This mojo checks if there is a Runnable provided via MavenExecutionRequest data and if there is, it calls it.
- In my M2E based code, I execute this mojo and pass the calling of the real execution plan via a lambda _expression_.
It would be nice if there was a function to execute multiple mojo-s in a row where mavenproject state is not persisted and restored between the mojo executions.
Kind regards,