slachiewicz opened a new issue, #1232: URL: https://github.com/apache/maven-plugin-tools/issues/1232
### Affected version 4.0.0-beta-3; the code is unchanged on master ### Bug description `ExecuteAnnotationContent.phase(String)` matches the value against `LifecyclePhase` and otherwise keeps it as a custom phase, then its last line overwrites the result with `LifecyclePhase.valueOf(phase)` ([ExecuteAnnotationContent.java:75](https://github.com/apache/maven-plugin-tools/blob/master/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/ExecuteAnnotationContent.java#L75)). A standard phase id such as `generate-sources` returns from the loop before reaching that line. Any other value throws, so the Maven 4 API `@Execute` cannot fork a custom phase (the case [MPLUGIN-439](https://github.com/apache/maven-plugin-tools/issues/759) added `customPhase` for), and `@Execute(phase = "none")` fails too: ``` Error extracting plugin descriptor: 'java.lang.reflect.InvocationTargetException': No enum constant org.apache.maven.plugins.annotations.LifecyclePhase.none ``` Reproduced with maven-plugin-plugin 4.0.0-beta-3 under Maven 4.0.0-rc-7 with `@Execute(phase = "none")` and with `@Execute(phase = "my-phase")` on an otherwise empty mojo. The loop came in with [010c9b2e](https://github.com/apache/maven-plugin-tools/commit/010c9b2efe5a4baa264e5b9750e0bfc471590398) (MPLUGIN-508); line 75 is the method's earlier body and should go. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
