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 06:09:00 UTC

[jira] [Commented] (MCOMPILER-437) Clarify how to use --patch-module

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

Gili commented on MCOMPILER-437:
--------------------------------

Per https://issues.apache.org/jira/browse/MCOMPILER-311?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel the documentation seems to be incorrect.

The correct syntax is <arg>--patch-module=org.apache.sshd.core=sshd-common-2.6.0-SNAPSHOT.jar, sshd-core-2.6.0-SNAPSHOT.jar</arg> not:

<arg>--patch-module</arg>
<arg>org.apache.sshd.core=sshd-common-2.6.0-SNAPSHOT.jar, sshd-core-2.6.0-SNAPSHOT.jar</arg>

So I am no longer getting the "Can't locate X" error. That said, the resulting module still does not work as expected:

package org.apache.sshd.client.config.keys is not visible
  (package org.apache.sshd.client.config.keys is declared in the unnamed module, but module myapplication does not read it)

I expected this to work because my application's module-info.java contains "requires org.apache.sshd.core". The package in question should be coming from the sshd-common JAR file, not from the unnamed module.

> Clarify how to use --patch-module
> ---------------------------------
>
>                 Key: MCOMPILER-437
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-437
>             Project: Maven Compiler Plugin
>          Issue Type: Improvement
>    Affects Versions: 3.8.1
>            Reporter: Gili
>            Priority: Major
>
> https://maven.apache.org/plugins/maven-compiler-plugin/examples/jpms_args.html says that the --patch-module syntax is:
> --patch-module <module>=<module>(, <module>)*
> But I am unable to get it to work. I always get "Can't locate X".
> I couldn't find any integration tests or other example code showing how to get this to work when the right hand side is meant to be a JAR file.
> I am trying to work around split packages in org.apache.sshd:ssh-common and org.apache.sshd:ssh-core by declaring a single module org.apache.sshd.core that is meant to contain a merge of the two JAR files. How can I make this work?
> Consider augmenting the documentation and/or adding an integration test to make this use-case more obvious. Thank you.



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