简体   繁体   中英

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM