Gradle и module-info.java, нет доступа к зависимости

build.gradle у меня слудующий

plugins {
    id 'java'
    id 'application'
    id 'org.javamodularity.moduleplugin' version '1.8.12'
    id 'org.openjfx.javafxplugin' version '0.0.13'
    id 'org.beryx.jlink' version '2.25.0'
}

group 'com.student'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
    maven {
        url "https://releases.aspose.com/java/repo/"
    }
}

ext {
    junitVersion = '5.10.0'
}

sourceCompatibility = '21'
targetCompatibility = '21'

tasks.withType(JavaCompile).configureEach {
    options.encoding = 'UTF-8'
}

application {
    mainModule = 'com.student.osb'
    mainClass = 'com.student.osb.HelloApplication'
}

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

dependencies {
    implementation('com.aspose:aspose-cells:24.2')
    implementation('org.controlsfx:controlsfx:11.1.2')
    implementation('com.dlsc.formsfx:formsfx-core:11.6.0') {
        exclude(group: 'org.openjfx')
    }

    testImplementation("org.mockito:mockito-core:3.12.4")
//    testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
//    testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
}

test {
    useJUnitPlatform()
}

jlink {
    imageZip = project.file("${buildDir}/distributions/app-${javafx.platform.classifier}.zip")
    options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
    launcher {
        name = 'app'
    }
}

jlinkZip {
    group = 'distribution'
}

а тут файл module-info.java

module com.student.osb {
    requires javafx.controls;
    requires javafx.fxml;

    requires org.controlsfx.controls;
    requires com.dlsc.formsfx;
    requires aspose.cells;

    opens com.student.osb to javafx.fxml;
    opens com.student.osb.model to javafx.base;

    exports com.student.osb;

}

так вот, проблема в том, что если я удаляю aspose.cells из файла module-info.java то все запускается, а после того как добавляю ошибка:

> Task :HelloApplication.main() FAILED
Error occurred during initialization of boot layer
java.lang.module.FindException: Module aspose.cells not found, required by com.student.osb

Execution failed for task ':HelloApplication.main()'.
> Process 'command 'C:\Program Files\Java\jdk-21\bin\java.exe'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 1s
4 actionable tasks: 3 executed, 1 up-to-date

Помогите, я чувствую что я чего-го не знаю, что-то упускаю...


Ответы (0 шт):