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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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