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 2020/10/12 07:05:00 UTC

[jira] [Comment Edited] (MCOMPILER-436) Cannot compile code that depends on on Apache Mina SSH due to JPMS error

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

Gili edited comment on MCOMPILER-436 at 10/12/20, 7:04 AM:
-----------------------------------------------------------

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

* Adding 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.
* 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.


was (Author: cowwoc):
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)