gnodet opened a new issue, #1240:
URL: https://github.com/apache/maven-plugin-tools/issues/1240

   _Claude Code on behalf of Guillaume Nodet_
   
   ## Context
   
   `ExecuteAnnotationContent` (and the Maven 3 `@Execute` annotation) has two 
separate fields for lifecycle phases:
   - `phase` (`LifecyclePhase` enum) — for standard Maven 3 phases
   - `customPhase` (`String`) — added in 3.8.0 (MPLUGIN-439) as an escape hatch 
for non-standard phase ids
   
   This made sense when the annotation API used an enum, but in Maven 4 the 
distinction no longer holds:
   - Maven 4's `@Execute.phase()` is a plain `String`, no enum
   - Maven 4 has hierarchical phase names (`after:test-compile`, 
`before:integration-test`, etc.)
   - Custom phases can be user-defined via `reactor.xml` 
(https://github.com/apache/maven/pull/13249)
   
   The `LifecyclePhase` enum is frozen at Maven 3's standard phases and cannot 
represent any of the above.
   
   ## Current behavior
   
   The `phase(String)` method loops through `LifecyclePhase` values, matching 
by `id()` or `name()`. If no match is found, it falls through to `customPhase`. 
Both paths ultimately produce the same result in `plugin.xml` via 
`mojoDescriptor.setExecutePhase(String)`.
   
   This means all Maven 4 phases that aren't in the Maven 3 enum are silently 
treated as "custom" phases — it works, but the internal model doesn't reflect 
reality.
   
   ## Proposal
   
   - Collapse `phase`/`customPhase` into a single `String` internally in 
`ExecuteAnnotationContent`
   - Keep the `LifecyclePhase` enum matching as a convenience for Maven 3 
annotation scanning (ASM sends enum constant names), but store the result as a 
string id
   - Handle `"none"` (case-insensitive) as the "disabled / no phase" semantic 
(empty string), matching Maven 3's `LifecyclePhase.NONE`
   - No validation against a fixed phase list — Maven 4 phases are open-ended
   
   Related: #1232, PR #1235


-- 
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]

Reply via email to