Hi all,
Is it possible to execute a plugin from a plugin? For instance, if I want to programmatically call another plugin from within a plugin, not via static XML.
Is this possible, how would I do that?
Thanks,
Walter
Hi all,
Is it possible to execute a plugin from a plugin? For instance, if I want to programmatically call another plugin from within a plugin, not via static XML.
Is this possible, how would I do that?
Thanks,
Walter
There are several ways to do this:
This has pros and cons, especially since you're building the project twice, but a common pattern is to modify the maven model, write it out to the file system as a temporary pom XML file, point the invoker to this pom. Drawback: you're losing the original model and wasting resources. Pro: you can do anything you want to the (new) maven model dynamically. This is very powerful
Extending is a lot simpler, configuration is automatically there (Google for maven extend plugin ). By Aggregation I mean calling the plugin programmatically which means you will probably have to access the plexus container to wire up the plugin configuration