This is my module-info:
open module org.client.main {
exports org.apj.client.app;
requires javafx.controls;
requires javafx.base;
requires javafx.fxml;
requires spring.context;
requires spring.web;
requires java.sql;
requires spring.beans;
requires spring.core;
}
This is my parent gradle build file:
subprojects {
afterEvaluate {
repositories {
jcenter()
}
compileJava {
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
]
classpath = files()
}
}
compileTestJava {
inputs.property("moduleName", moduleName)
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
'--add-modules', 'junit',
'--add-reads', "$moduleName=junit",
'--patch-module', "$moduleName=" + files(sourceSets.test.java.srcDirs).asPath,
]
classpath = files()
}
}
test {
inputs.property("moduleName", moduleName)
doFirst {
jvmArgs = [
'--module-path', classpath.asPath,
'--add-modules', 'ALL-MODULE-PATH',
'--add-reads', "$moduleName=junit",
'--patch-module', "$moduleName=" + files(sourceSets.test.java.outputDir).asPath,
]
classpath = files()
}
}
}
}
This is my client module build file:
plugins {
id 'java'
}
group 'APJ'
version '1.0-SNAPSHOT'
sourceCompatibility = 11
repositories {
mavenCentral()
}
dependencies {
compile group: 'org.springframework', name: 'spring-webmvc', version: '5.1.4.RELEASE'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
ext.moduleName = 'org.client.main'
I am trying to getResource for FXMLLoader but I simply can not get it to work. I have been struggling for 2 hours and I am really desperate right now. I have tried like every possible combination of file name, every possible location but still it is returning null.
Also I have tried ClassLoader.getSystemClassLoader().getResource("/login.fxml")
getClass().getResource("/login.fxml")
But it is also not working.
Can someone help me with this ? I would be very grateful.