gnodet commented on PR #13774:
URL: https://github.com/apache/maven/pull/13774#issuecomment-6654019564

   Thank you for working on this — the bug is real and the investigation is 
appreciated. However, the approach taken in this PR has fundamental issues that 
prevent us from merging it. A detailed analysis has been posted on the linked 
issue: https://github.com/apache/maven/issues/10851#issuecomment-6654015990
   
   **Summary of concerns:**
   
   1. **Wrong abstraction layer** — filtering by `maven.test.skip` inside 
`DefaultProjectDependenciesResolver` (a generic service) silently breaks any 
caller that legitimately needs the full test dependency graph (analysis 
plugins, reporting, etc.).
   
   2. **Cache poisoning** — `ProjectArtifactsCache` does not include 
`maven.test.skip` in its key. Mixed-flag scenarios in the same session will 
return stale cached results.
   
   3. **Incomplete** — only `maven.test.skip` is handled; `-DskipTests`, 
`-DskipITs` and any plugin-specific skip flags are not. This cannot be 
maintained exhaustively in Maven core.
   
   4. **Maven 4 regression** — in Maven 4, plugins using `@Resolution` bypass 
`LifecycleDependencyResolver` entirely; the filter added to 
`DefaultProjectDependenciesResolver` would silently truncate results for any 
Maven 4 plugin that requests test-scoped dependencies for a legitimate reason.
   
   The correct fix is at the plugin level (jar plugin should make `test-jar` 
artifacts servable by the reactor even when skipped; compiler plugin should not 
request test resolution when skipping test compilation). For Maven 4, a lazy 
proxy on `@Resolution` would give plugins full control over when — and whether 
— resolution is triggered.


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