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

   Hi @desruisseaux, those are great points, and the intersection with JPMS is 
definitely an important consideration. 
   
   I don't believe this introduces technical debt, but rather bridges a 
critical feature gap that the community has been requesting for a long time. 
There are a few reasons why adding this to Maven is beneficial even alongside 
Java modules:
   
   1. **Ecosystem Reality:** JPMS was introduced in Java 9 nearly a decade ago, 
yet adoption remains surprisingly low across the broader ecosystem. The vast 
majority of Java projects still rely entirely on the classpath. Introducing a 
build-tool level isolation mechanism (similar to Gradle's highly successful 
`api`/`implementation` split) immediately benefits the 90%+ of projects that 
don't (or can't) use JPMS, providing them with better encapsulation and faster 
incremental builds.
   2. **Alignment with Industry Standards:** The `compile` (implementation) vs 
`api` distinction has become an industry standard pattern for dependency 
management. Aligning Maven's scopes with this model reduces friction for 
developers moving between build tools and makes it easier to reason about 
dependency intent without diving into module descriptors.
   3. **Complementary, Not Conflicting:** Even for modular projects, defining 
the logical intent in the POM (`api` vs `compile`) is valuable. In the future, 
Maven plugins or the compiler could theoretically use these scopes to 
automatically scaffold or validate `module-info.java` files (e.g., ensuring an 
`api` scope maps to `requires transitive` and a `compile` scope maps to a 
standard `requires`).
   
   Ultimately, this gives developers the tools to enforce encapsulation today, 
without forcing them to undertake a full migration to JPMS before they are 
ready.
   


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