Open JaneWardSandy opened 1 year ago
Gradle: 8.2 IDEA: 2023.2.2
I have a Gradle with Kotlin project with two modules.
Gradle with Kotlin
build.gradle.kts file of module A
build.gradle.kts
plugins { id("org.openjfx.javafxplugin") version "0.1.0" } javafx { version = "21" configuration = "api" modules("javafx.base", "javafx.graphics", "javafx.controls", "javafx.media", "javafx.web") }
build.gradle.kts file of module B
dependencies { api(project(":a")) }
In the class code of module B, import javafx.application.Application but error Unresolved reference: javafx will be reported.
import javafx.application.Application
Unresolved reference: javafx
But if I downgrade the plug-in version to 0.0.14, everything will work properly.
0.0.14
Execute B:dependencies -q with 0.0.14
B:dependencies -q
compileClasspath - Compile classpath for null/main. +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10 | +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.10 | | +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10 | | \--- org.jetbrains:annotations:13.0 | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10 | \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.10 (*) \--- project :A +--- org.openjfx:javafx-base:21 +--- org.openjfx:javafx-graphics:21 | \--- org.openjfx:javafx-base:21 +--- org.openjfx:javafx-controls:21 | \--- org.openjfx:javafx-graphics:21 (*) +--- org.openjfx:javafx-media:21 | \--- org.openjfx:javafx-graphics:21 (*) +--- org.openjfx:javafx-web:21 | +--- org.openjfx:javafx-controls:21 (*) | \--- org.openjfx:javafx-media:21 (*) \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10 (*)
And with 0.1.0
0.1.0
compileClasspath - Compile classpath for null/main. +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10 | +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.10 | | +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10 | | \--- org.jetbrains:annotations:13.0 | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10 | \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.10 (*) \--- project :A +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10 (*) +--- org.openjfx:javafx-base:21 +--- org.openjfx:javafx-graphics:21 | \--- org.openjfx:javafx-base:21 +--- org.openjfx:javafx-controls:21 | \--- org.openjfx:javafx-graphics:21 (*) +--- org.openjfx:javafx-media:21 | \--- org.openjfx:javafx-graphics:21 (*) \--- org.openjfx:javafx-web:21 +--- org.openjfx:javafx-controls:21 (*) \--- org.openjfx:javafx-media:21 (*)
Testing project: jfx_demo.zip
Gradle: 8.2 IDEA: 2023.2.2
I have a
Gradle with Kotlin
project with two modules.build.gradle.kts
file of module Abuild.gradle.kts
file of module BIn the class code of module B,
import javafx.application.Application
but errorUnresolved reference: javafx
will be reported.But if I downgrade the plug-in version to
0.0.14
, everything will work properly.Execute
B:dependencies -q
with0.0.14
And with
0.1.0
Testing project: jfx_demo.zip