Skip to content

compiler plugin does not process JPMS patch modules correctly #321

@larry-cable

Description

@larry-cable

Affected version

3.5.9

Bug description

the java module system supports the ability to compile and execute "patch modules" these are patches to existing modules that override pre-existing content with replacements.

in order to compile (patch) classes for inclusion as a "patch module" the javac compiler supports a cmdline option: --patch-module <module-name>=<path-to-module-source-root>
invoking javac directly with the --patch-module... option specified works as intended, however when attempting to use the maven plugin compiler with:
<compilerArgs> <arg>--patch-module</arg> <arg>java.base=${project.basedir}/...</arg> </compilerArgs>

specifying the same '' as with the invocation of javac the plugin fails to compile the patch classes.

the failures reported suggest that the compiler is failing to resolve dependencies expressed in the sources of the patch classes against the target module being patched...

e.g:

I have a module that contains a number of classes and packages, and I wish to patch an existing class therein
so I create a "patch" class in tne maven project.

such a class may of course refer to other classes that already exist in the module to be patch, but those dependencies are not patched themselves.

the patched class compilation will fail (when compiled by the plugin) with errors naming any references to
dependencies in the target module as non-existent

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions