Clarification needed regarding modulepath containing multiple modules with the same name

Alan Bateman Alan.Bateman at oracle.com
Wed Dec 5 13:52:48 UTC 2018



On 05/12/2018 13:01, cowwoc wrote:
> (Apologies if this gets posted twice. My first attempt didn't seem to go
> through)
>
> Hi,
>
> Can one of the committers for project jigsaw please post a comment in this
> issue https://issues.apache.org/jira/browse/MJLINK-27
>
> I have been trying, unsuccessfully, to reach consensus with Maven
> committers.
>
> It is my interpretation that the modulepath may contain multiple modules
> with the same name, so long as the module entries are JAR files as opposed
> to directories.
>
> Maven committers are of the opinion that the modulepath may never contain
> multiple modules with the same name.
>
JEP 261 reads: "When searching a module path for a module of a 
particular name, the module system takes the first definition of a 
module of that name. "

so yes, if you've got say two directories on the module path and they 
both contain module M then M will be found in the first directory, the M 
in the second directory will be ignored.

The linked comment about it being an error to have a directory on the 
module path containing multiple versions of the same module is also correct.

I can't tell from the linked issues if this is an issue with Maven's 
module path implementation or something specific to the Maven jlink 
plugin. I'm sure Robert will know.

-Alan


More information about the jigsaw-dev mailing list