Sahil-Jaiswal-189 opened a new pull request, #14014:
URL: https://github.com/apache/maven/pull/14014

   ## Summary
   
   Fixes the missing `MojoExecution` getters reported in #14000.
   
   Restores the seven deprecated getters with their original signatures, 
delegating to the corresponding noun-style accessors. Optional values are 
converted to the legacy nullable return types where required. Tests cover both 
populated and absent values.
   
   ## Dependency implementation compatibility
   
   A separate issue affects plugins compiled against Maven 4.0 whose 
`Dependency` implementations provide only legacy getters. Master expects 
noun-style methods, which can result in `AbstractMethodError`.
   
   Two approaches were considered:
   
   1. **Make legacy getters abstract and noun-style methods delegate to them.** 
This supports older implementations and preserves compile-time enforcement, but 
requires existing noun-only implementations—including those on master—to add or 
change methods.
   2. **Provide defaults in both directions, guarded against recursive 
delegation.** This supports both implementation styles without changing 
existing classes, but adds reflection and caching. It also moves detection of 
missing implementations from compile time to runtime.
   
   These changes are excluded from this PR pending guidance on the preferred 
approach.
   
   ## Separate Assembly plugin failure
   
   The Assembly plugin’s `inline-descriptor` integration test fails on master 
with:
   
   ```text
   Misconfigured file: specify destName when using sources
   ```
   
   The same test passes on `maven-4.0.x`. Its configuration supplies a singular 
`<source>`, but the failure indicates that it is being handled as plural 
`sources`. This appears related to configuration binding; the exact cause still 
needs confirmation.
   
   Restoring the `MojoExecution` getters does not resolve this failure. I 
suggest investigating it in a separate fix.
   
   ## Verification
   
   - All four `DefaultMojoExecutionTest` tests pass.
   - Checkstyle and Spotless pass.
   - The Maven 4 plugin ports on `agent/mvn4-api` pass their configured 
integration suites with the getter fix:
     - Antrun: 29 passed.
     - Checkstyle: 12 passed.
   - Assembly and Dependency plugin testing exposed the separate issues 
described above.
   
   ---
   
   To make clear that you license your contribution under the [Apache License 
Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0), check 
one of the following:
   
   - [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]

Reply via email to