Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How to replace “attainGoal” in maven 1 with plugin in maven 2?

Maven plugin replace
0
Posted

How to replace “attainGoal” in maven 1 with plugin in maven 2?

0

I would like to write up a plugin that have multiple goals. Does anyone have some samples that can share? Basically, a sample goal that compiles the source and another one that packages it as a WAR would be sufficient. Please help and thanks in advance The way to ‘call goals’ in maven 2 is using plugin. I think what you should do is write a plugin that comprises of other plugins (goals) that you wish to call with their respective phase. So when you call this plugin (say during compile phase), it in turn will call your ‘configured plugins’ to do their work. This has the same effect of specifying multiple goals. I believe one can do the same thing without writing a plugin for it but if your requirements demand it, yes you can do it that way. For example I wrote a maven 2 plugin (boiler plate code generator) that uses jaxme plugin with some additional processing. I did sort of the same thing. This ‘MyPlugin’ used jaxme plugin & did some more operation as part of it’s ‘phase’.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123