[
https://issues.apache.org/jira/browse/MPLUGIN-439?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17630250#comment-17630250
]
ASF GitHub Bot commented on MPLUGIN-439:
----------------------------------------
slawekjaranowski commented on code in PR #170:
URL:
https://github.com/apache/maven-plugin-tools/pull/170#discussion_r1016239783
##########
maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Execute.java:
##########
@@ -39,20 +39,31 @@
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.
+ * This value takes precedence over the {@link #customPhase()}.
* @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 {@link #phase}
overrides the specified custom phase.
+ * Also specifying a custom phase overrides specifying a goal.
+ * This element should only be used for non-standard phases. For standard
phases rather use {@link #phase()}.
+ *
+ * @since 3.8.0
+ */
+ String customPhase() default "";
Review Comment:
maybe an error or at least warning if user defined both
In many case users don't read a documentation.
> Execute annotation only supports standard lifecycle phases due to use of enum
> -----------------------------------------------------------------------------
>
> Key: MPLUGIN-439
> URL: https://issues.apache.org/jira/browse/MPLUGIN-439
> Project: Maven Plugin Tools
> Issue Type: Improvement
> Components: maven-plugin-annotations
> Reporter: Konrad Windszus
> Assignee: Konrad Windszus
> Priority: Major
>
> The {{Execute}} annotation defined at
> https://github.com/apache/maven-plugin-tools/blob/6dfbd4b6e2674b81702d3417e57b471afad40535/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Execute.java#L45
> only supports one of the predefined phases from
> https://github.com/apache/maven-plugin-tools/blob/master/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/LifecyclePhase.java.
> That can't be used for custom lifecycle ids, though.
> There should be another element on that annotation which should allow to use
> custom ids (as regular String values).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)