Repository navigation
Keep a custom @Execute phase instead of resolving it as an enum - #1235
Open
CaptainAni187 wants to merge 1 commit into
Open
CaptainAni187 wants to merge 1 commit into
CaptainAni187 wants to merge 1 commit into
Conversation
ExecuteAnnotationContent.phase(String) already matches the value against LifecyclePhase and keeps anything else as a custom phase, but its last line then overwrote the result with LifecyclePhase.valueOf(phase). A standard phase returns from the loop before reaching that line; any other value threw, so @execute(phase = "my-phase") and @execute(phase = "none") failed descriptor extraction with "No enum constant LifecyclePhase.none". Drop the leftover line, which predates the loop added for MPLUGIN-508. Fixes apache#1232
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1232.
ExecuteAnnotationContent.phase(String)already maps a standard phase id or enum name toLifecyclePhaseand keeps any other value ascustomPhase, but its last line then overwrote the result withLifecyclePhase.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 withNo enum constant ... LifecyclePhase.none.This removes that leftover line. The extractor already turns
customPhaseinto 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 phasenone, while Maven 3LifecyclePhase.NONEstill resolves to the enum, whose id is"". I kept to the fix described in the issue rather than mapping"none"toNONE; happy to add that if you'd prefer.