[ 
https://issues.apache.org/jira/browse/MCOMPILER-436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17212166#comment-17212166
 ] 

Gili commented on MCOMPILER-436:
--------------------------------

I've lost 5 hours of my life to this issue. I've tried:

* I added Automatic-Module-Name to Apache Mina SSH. This caused it to show up 
as a JPMS module so my applications' module-info could finally refer to it. But 
I cannot use it because it has a split package problem.
* I tried using --patch-module per 
https://nipafx.dev/five-command-line-options-hack-java-module-system to add all 
the packages of org.apache.sshd.common into the org.apache.sshd.core JPMS 
module but I was never able to get this to work. The compiler keeps on 
complaining that the org.apache.sshd.core JPMS module does not contain the 
packages I am trying to add using patch-module.

I finally got this working using the workaround described at 
https://stackoverflow.com/a/53329288/14731 but it's a rather ugly hack. I am 
hoping to improve upon this.

> Cannot compile code that depends on on Apache Mina SSH due to JPMS error
> ------------------------------------------------------------------------
>
>                 Key: MCOMPILER-436
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-436
>             Project: Maven Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 3.8.1
>            Reporter: Gili
>            Priority: Major
>         Attachments: extract-module-name.zip
>
>
> 1. Extract Testcase
> 2. Run "mvn clean install"
> 3. Build fails with:
> [WARNING] Can't extract module name from sshd-core-2.5.1.jar: Provider class 
> org.apache.sshd.common.file.root.RootedFileSystemProvider not in module
> [ERROR] module not found: sshd.core
> Expected behavior: The plugin should be able to extract the module name given 
> that sshd-core depends on sshd-commons which contains the aforementioned 
> provider and automatic modules can access classes outside their module.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to