Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Defining custom lifecycle phases in Maven 2

In my pom.xml I have referenced a custom plugin, which is exposing a couple of goals. While I can attach these goals to the various build life-cycle phases, I would like to be able to invoke a set of goals defined in the POM by using my custom alias phase on the command line, such as:

mvn myphase

Is there any way to accomplish this? I would like to avoid modifying my plugin as I need to run some auxiliary operations, which are provided by the antrun plugin.

like image 970
Thilo-Alexander Ginkel Avatar asked Aug 03 '11 15:08

Thilo-Alexander Ginkel


1 Answers

You want to invoke a custom phase not a goal (changed your question). You have to write your custom lifecycle which will include your custom phase. Do you really want to do that? Have a look at this.

like image 133
Michael-O Avatar answered Sep 18 '22 13:09

Michael-O