`@Execute` with a custom phase or `"none"` fails descriptor extraction
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- java
- Domain
- build-system
Research direction
Start in maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/datamodel/ExecuteAnnotationContent.java at phase(String), especially the overwrite identified around line 75. Reproduce descriptor extraction with @Execute(phase = "none") and a custom phase such as "my-phase"; done means both values no longer throw and standard lifecycle phases still work.
Written by the indexing model from the issue text.
Description
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). 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 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 (MPLUGIN-508); line 75 is the method's earlier body and should go.
- Dominant language
- Java
- Stars
- 63
- Forks
- 76
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 27
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/maven-plugin-tools
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
apache/maven-plugin-tools#1233 · 5 comments ·
Maintainers usually reply within 1 day
-
`descriptor` fails on `onlineRequired`, `dependencyCollection` and `dependencyResolutionPathScopes` in the Maven 4 API `@Mojo`Possibly taken @efegokdemir claimed this 8 days ago. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 65/100
apache/maven-plugin-tools#1231 · 1 comment ·
Maintainers usually reply within 1 day
-
`@Resolution` fields stay null: `plugin.xml` gets no `<resolutions>`Possibly taken @goutamadwant claimed this 13 days ago. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 72/100
apache/maven-plugin-tools#1230 · 1 comment ·
Maintainers usually reply within 1 day
-
Generated factory for a Maven 4 API mojo requires a no-arg constructorPossibly taken @CaptainAni187 claimed this 10 days ago. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
apache/maven-plugin-tools#1229 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
apache/maven-plugin-tools#1080 · 7 comments · 1 reaction ·
Maintainers usually reply within 1 day
All issues in apache/maven-plugin-tools
Similar issues
-
StepExamBenchmarkTest runs a loop and prints a timing but asserts nothingPossibly taken A pull request linked to this issue is open or already merged. Openjules
Difficulty 1/5 Under an hour Newbie friendliness 82/100
open-learning-exchange/myplanet#18199 · 1 comment ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Scheme-less stream URLs throw NullPointerException instead of URISyntaxExceptionPossibly taken @blihio claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
pedroSG94/RootEncoder#2218 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
apache/rocketmq-dashboard#6872 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ADORSYS-GIS/token-status-link#168 ·
Maintainers usually reply within 2 days