You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kw...@apache.org on 2022/11/09 11:49:37 UTC

[maven] 01/01: [MPLUGIN-439] Support custom lifecycle phase ids in Execute annotation

This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch feature/custom-phase-ids-in-execute-annotation
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 2b81c6730fec147cec931f9ef98512de1302aadb
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Wed Nov 9 12:49:25 2022 +0100

    [MPLUGIN-439] Support custom lifecycle phase ids in Execute annotation
---
 .../org/apache/maven/api/plugin/annotations/Execute.java | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/plugin/annotations/Execute.java b/api/maven-api-core/src/main/java/org/apache/maven/api/plugin/annotations/Execute.java
index e4f870786..6aec36666 100644
--- a/api/maven-api-core/src/main/java/org/apache/maven/api/plugin/annotations/Execute.java
+++ b/api/maven-api-core/src/main/java/org/apache/maven/api/plugin/annotations/Execute.java
@@ -41,20 +41,30 @@ import org.apache.maven.api.annotations.Experimental;
 public @interface Execute
 {
     /**
-     * lifecycle phase to fork. Note that specifying a phase overrides specifying a goal.
+     * Lifecycle phase to fork. Note that specifying a phase overrides specifying a goal.
+     * For custom lifecycle phase ids use {@link #customPhase()} instead.
+     * Only one of {@link #customPhase()} and {@link #phase()} must be set.
      * @return the phase
      */
     LifecyclePhase phase() default LifecyclePhase.NONE;
 
     /**
-     * goal to fork. Note that specifying a phase overrides specifying a goal. The specified <code>goal</code> must be
+     * Custom lifecycle phase to fork. Note that specifying a phase overrides specifying a goal.
+     * This element should only be used for non-standard phases. For standard phases rather use {@link #phase()}.
+     * Only one of {@link #customPhase()} and {@link #phase()} must be set.
+     * @return the custom phase id
+     */
+    String customPhase() default "";
+
+    /**
+     * Goal to fork. Note that specifying a phase overrides specifying a goal. The specified <code>goal</code> must be
      * another goal of the same plugin.
      * @return the goal
      */
     String goal() default "";
 
     /**
-     * lifecycle id of the lifecycle that defines {@link #phase()}. Only valid in combination with {@link #phase()}. If
+     * Lifecycle id of the lifecycle that defines {@link #phase()}. Only valid in combination with {@link #phase()}. If
      * not specified, Maven will use the lifecycle of the current build.
      *
      * @see <a href="https://maven.apache.org/maven-plugin-api/lifecycle-mappings.html">Lifecycle Mappings</a>