CaptainAni187 opened a new pull request, #1235: URL: https://github.com/apache/maven-plugin-tools/pull/1235
Fixes #1232. `ExecuteAnnotationContent.phase(String)` already maps a standard phase id or enum name to `LifecyclePhase` and keeps any other value as `customPhase`, but its last line then overwrote the result with `LifecyclePhase.valueOf(phase)`. A standard phase returns from the loop before reaching it; any other value threw, so `@Execute(phase = "my-phase")` and `@Execute(phase = "none")` failed descriptor extraction with `No enum constant ... LifecyclePhase.none`. This removes that leftover line. The extractor already turns `customPhase` into the descriptor's execute phase, so nothing else needed to change. Added `ExecuteAnnotationContentTest`: a standard phase id, an enum constant name, a custom phase and `"none"`. The last two fail on master with the error from the issue. One thing worth a look: with this change, Maven 4 `@Execute(phase = "none")` is kept as the custom phase `none`, while Maven 3 `LifecyclePhase.NONE` still resolves to the enum, whose id is `""`. I kept to the fix described in the issue rather than mapping `"none"` to `NONE`; happy to add that if you'd prefer. --- - [x] I hereby declare this contribution to be licensed under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0) - [ ] I hereby declare that I have filed an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). -- 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]
