Defining Custom Life Cycle Phases in Maven 2

In my pom.xml I refer to a custom plugin that displays a couple of targets. Although I can attach these goals to the various stages of the build life cycle, I would like to be able to invoke the set of goals defined in the POM using my custom alias phase on the command line, such as:

 mvn myphase 

Is there any way to do this? I would like to avoid modifying my plugin since I need to run some helper operations that are provided by the antrun plugin.

+6
source share
1 answer

You want to trigger a custom phase not a goal (changed your question). You must write your own life cycle that will include your custom phase. Do you really want to do this? Take a look at this one .

+8
source

Source: https://habr.com/ru/post/894203/


All Articles