Skip to content

Make LEMMA compatible with the Java Platform Module System #53

@frademacher

Description

@frademacher

When executing a LEMMA model processor we currently get warnings like

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by nonapi.io.github.classgraph.classpath.CallStackReader (file:/home/florian/Dokumente/Forschung/Dissertation/eclipse-workspace/code%20generators/de.fhdo.lemma.model_processing.code_generation.java_base/build/libs/de.fhdo.lemma.model_processing.code_generation.java_base-0.8.5-SNAPSHOT-standalone.jar) to method java.lang.SecurityManager.getClassContext()
WARNING: Please consider reporting this to the maintainers of nonapi.io.github.classgraph.classpath.CallStackReader
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

This is due to the Java Platform Module System (JPMS), which since Java 9 checks for not explicitly allowed accesses between classpath dependencies (cf. https://www.baeldung.com/java-9-modularity for a more technical explanation). To prevent such warnings (which in future Java releases will be handled more strictly), we would need to convert LEMMA to be compatible with JPMS (in fact, the above warning is from the ClassGraph library with LEMMA's model processing framework scans the classpath for annotations).

Unfortunately, Xtext currently seems to prevent us from porting LEMMA to JPMS given its org.eclipse.xtext and the transitive org.eclipse.xtext.util dependency both define the split package "org.eclipse.xtext.util". As it seems, JPMS however prevents split package accesses. See detailed example of the problem here: https://github.com/frademacher/xtext-jpms-test (with an elaborate explanation here: https://github.com/frademacher/xtext-jpms-test/blob/main/build.gradle.kts). Thus, we probably need to wait until Xtext is made JPMS-enabled upstream.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions