'java.lang.RuntimeException: Unable to parse --add-opens

When building mailclient java module through gradle build i get the following error in the :test task

Task :test FAILED
Error occurred during initialization of boot layer
java.lang.RuntimeException: Unable to parse --add-opens <module>/<package>: com.unito.mailclient/

I'm building with gradle a modularized java solution which is structured in the following way:

  • module common: shared between different applications;
  • module mailclient: one of the applications utilizing common module.

Common and mailclient are siblings in the folder structure. Running gradle build for common module results in no errors.


build.gradle (mailclient)


plugins {
    id 'application'
    id 'jacoco'
    id 'org.openjfx.javafxplugin' version '0.0.10'
}

repositories {
    mavenCentral()
}

dependencies {
    implementation project(':common')
    implementation 'com.google.inject:guice:5.1.0'
    annotationProcessor 'org.projectlombok:lombok:1.18.22'
    testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1'
    testImplementation 'org.mockito:mockito-junit-jupiter:2.19.0'
    testImplementation 'org.mockito:mockito-core:4.3.0'

    implementation 'org.kordamp.bootstrapfx:bootstrapfx-core:0.4.0'
    implementation 'com.google.guava:guava:30.1.1-jre'
}

java {
    modularity.inferModulePath.set(true)
}

jacoco {
    toolVersion = "0.8.7"
}

jacocoTestReport {
    dependsOn test 
}

testing {
    suites {
        test {
            useJUnitJupiter('5.8.1')
        }
    }
}

javafx {
    version = "17.0.1"
    modules = ['javafx.controls', 'javafx.fxml']
}

application {
    mainModule = 'com.unito.mailclient'
    mainClass = 'com.unito.mailclient.HelloApplication'
}

group = 'com.unito'
description = 'mailclient'

module-info.java

module com.unito.mailclient {
    requires com.unito.common;
    requires com.google.gson;
    requires com.google.guice;
    requires javafx.controls;
    requires javafx.fxml;
    requires org.kordamp.bootstrapfx.core;
    requires javafx.graphics;
}

I'm not able to understand what is causing the problem; The error is not clear at all to me.

Can anybody give a hand please?



Solution 1:[1]

After cloning the project in another location the error went away. This error remains a mistery.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 voodoo_patch