Hello Romain
Le 2024-01-02 à 18 h 16, Romain Manni-Bucau a écrit :
In other words you deprecated isAddedToClasspath cause it was too
rigid to put in place something as rigid which enables one rare
(today) case so I'm not very enthusiatic about it.
The proposed replacement is not as rigid, because it is controlled by
dependency properties, which are themselves controlled by artifact
types. Furthermore, the proposal does not solve rare cases. I believe it
solves the vast majority of JPMS cases. For demonstrating my point, I
wrote two test cases with extensive explanations months ago showing why
Maven 3 doesn't work with JPMS [1][2]. If you believe that Maven 4 with
the proposed improvements would still not work, I propose that we still
create a prototype, so you can create a test case demonstrating why the
prototype doesn't work. For now, the arguments that I have seen against
the proposal were either proposing to use Maven like Ant (declare the
paths ourselves in <compilerArgs>), or were asking for troubles (not
encouraging consistency between javac, java, javadoc, etc. tools).
[1]https://github.com/Geomatys/MavenModulepathBug
[2]https://github.com/Geomatys/MavenModulepathBug/tree/cyclic-graph
Also, the fact that some types are now almost scopes also converges to
the "make the plugin own its paths interpretation" cause from a maven
core standpoint it looks wrong to mix both concepts
The fact that types may be like scope in not specific to JPMS. This is
why I asked for clarification in my previous email. I leave the decision
to core Maven developers, and will adapt the proposal as needed. From
JPMS perspective, as long as DependencyProperties is populated with the
information that I need, no matter if the information come from Type or
elsewhere, this is fine.
So overall I'm quite mixed and still have a hard time to see it going
anywhere else than a jpms extension which could sit outside maven to
preconfigure the plugins but not as a generic feature widely *re*usable
JPMS is core to Java, so I think it should be core to Maven too. All
standard Java tools to my knowledge handle JPMS in a consistent way,
with the same options when they apply. So I believe they are as
fundamental as the classpath. But anyway, as said above, for making
progress, I propose to go ahead with a prototype first, then demonstrate
the prototype shortcoming with test cases.
Martin