Hiteshsai007 commented on PR #12745:
URL: https://github.com/apache/maven/pull/12745#issuecomment-5312222339

   Thanks for the thorough review and for catching these critical edge cases, 
@gnodet! 
   
   I've pushed a new commit addressing all 6 points raised:
   
   ### 1. Consumer POM regression (high)
   **Fixed:** Replaced `!scope.isTransitive()` in 
`DefaultConsumerPomBuilder.hasDependencyScope()` with an explicit inclusion 
list (`COMPILE`, `RUNTIME`, `API`). This ensures that `compile`-scoped 
dependencies and unscoped dependencies are properly retained in consumer POMs 
unconditionally, fixing the silent stripping regression.
   
   ### 2. Resolver regression (high)
   **Fixed:** To maintain full backward compatibility for older projects while 
enforcing non-transitive `compile` in Maven 4, I updated 
`DefaultArtifactDescriptorReader.convert()`. When resolving dependencies from a 
POM with an older model version (`< 4.1.0`), dependencies declared with 
`compile` scope (or undefined) are internally mapped to the `api` scope. This 
guarantees they remain transitive for older artifacts while allowing `compile` 
to act as non-transitive for `4.1.0+` models.
   
   ### 3. Accidental files (high)
   **Fixed:** Cleaned up the working tree. `issue_comment.md` and the 
`plexus-sec-dispatcher` submodule have been removed from the repository index.
   
   ### 4. No tests (high)
   I am currently working on adding the comprehensive unit tests to cover 
consumer POM generation and the transitive resolution behavior. I'll push these 
up in a follow-up commit shortly to fulfill this requirement!
   
   ### 5. MavenModelVersion gap (medium)
   **Fixed:** Updated the Modello template (`src/mdo/model-version.vm`) to 
inject a `hasApiDependency()` check into the generated `MavenModelVersion` 
class. The validator now correctly detects `api`-scoped dependencies and 
dependency management entries, forcing the model version to `4.1.0` and 
preventing the `api` scope from inadvertently leaking into `4.0.0` consumer 
POMs.
   
   ### 6. Stale Javadoc (low)
   **Fixed:** Updated the Javadoc for `COMPILE` in `DependencyScope.java` to 
explicitly state `Compile, runtime and test (non-transitive).`
   


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