I am working on a Maven plugin, composed of 3 mojos inheriting AbstractMojo
.
Long story short, these 3 mojos are used to :
- compile some groovy scripts
- generate SQL scripts with data extracted from compilation
- load these scripts to a database
Previously, my 2nd mojo inherited the 1st, and the 3rd inherited the 2nd, and they all called super.execute()
in their execute()
method, so that they could cascade from each other.
I am rewriting the plugin in order to make it cleaner and better designed, thus I removed inheritance and want to rely on Maven native lifecycle, binding the 3 mojos to compile
, package
and deploy
phases.
The issue I am facing is that I can't figure out a clean way to pass to the 2nd mojo the data I extract during the 1st mojo's execution (like file extensions, if the file is correctly compiled, package path, etc). Is there any temporary storage or caching system available in the Maven plugin API ?