You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Gili (JIRA)" <ji...@apache.org> on 2018/12/06 00:58:00 UTC
[jira] [Comment Edited] (MJLINK-27) Code incorrectly assumes that
two modules won't have the same name
[ https://issues.apache.org/jira/browse/MJLINK-27?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16710817#comment-16710817 ]
Gili edited comment on MJLINK-27 at 12/6/18 12:57 AM:
------------------------------------------------------
I've updated the testcase to use maven-jlink-plugin.
In spite of the aforementioned bug in getModulePathElements(), which still needs to be fixed, the actual output by maven-jlink-plugin is correct. I can swap the dependency order and the first entry always shadows the second when I run "bin\java.exe -m com.company.main/com.company.main.Main" from the generated JAR file.
In its current form, getModulePathElements() will always be missing one of the "plugin" dependencies. Which one gets dropped is undefined. The expected behavior is for this method to return both the modules.
was (Author: cowwoc):
I've updated the testcase to use maven-jlink-plugin.
In spite of the aforementioned bug in getModulePathElements(), which still needs to be fixed, the actual output by maven-jlink-plugin is correct. I can swap the dependency order and the first entry always shadows the second.
In its current form, getModulePathElements() will always be missing one of the "plugin" dependencies. Which one gets dropped is undefined. The expected behavior is for this method to return both the modules.
> Code incorrectly assumes that two modules won't have the same name
> ------------------------------------------------------------------
>
> Key: MJLINK-27
> URL: https://issues.apache.org/jira/browse/MJLINK-27
> Project: Maven JLink Plugin
> Issue Type: Bug
> Affects Versions: 3.0.0-alpha-2
> Reporter: Gili
> Priority: Major
> Attachments: module-shadowing.zip
>
>
> Karl Heinz Marbaise closed MJLINK-7 referencing [a Stackoverflow post|https://stackoverflow.com/questions/46573572/java-9-possible-to-have-2-modules-with-same-name-on-module-path/46574200#46574200] to prove that module names must be unique. In fact, this Stackoverflow post says the exact opposite. The bottom half of the post states that modules in separate directories **are** allowed to have the same name. The bottom of the post concludes:
> {quote}That makes it possible to have the same module in different directories.
> {quote}
> It doesn't have to be the same module per-se. It is possible for two different implementations with the same module name to reside on the module path, so long as the modules reside in different directory. This is useful for "class shadowing". In my particular case, I ship a no-op implementation of a module by default but users can insert a working implementation in front of the module path to enable the feature.
> Please reopen this issue or continue its work here.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)