0

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?

voodoo_patch
  • 472
  • 4
  • 16
  • Hi @voodoo_patch could refer this link https://stackoverflow.com/questions/45970742/java9-jnlp-add-opens-not-working – Sathiyaraj Mar 06 '22 at 01:53
  • I hope this will help for you – Sathiyaraj Mar 06 '22 at 01:53
  • https://github.com/quarkusio/quarkus/issues/16862 – Sathiyaraj Mar 06 '22 at 01:53
  • @Sathiyaraj thanks for your reply. Unfortunately this does not seem to be my case. The first link points out a wrong setup of jvm args. The second one refers to quarkus which i'm not using. The point here is that i don't have the control of jvm args since i'm simply executing 'gradle build' command – voodoo_patch Mar 06 '22 at 14:24

1 Answers1

0

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

voodoo_patch
  • 472
  • 4
  • 16