How to replace “attainGoal” in maven 1 with plugin in maven 2?
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’.