Table of contents
Getting Resources
ClassLoader classLoader = getClass().getClassLoader(); URL resource = classLoader.getResource(path);
Optional<URL> url = resourceResolver.getResource("classpath:" + path);
Set Resources
Gradle
shadowJar {
// Ensure resources are included
mergeServiceFiles()
include 'EmailTemplate/**'
}
sourceSets {
main {
resources {
srcDirs = ['src/main/resources']
include '**/*.properties', '**/*.yml' // Add any specific file patterns if needed
}
}
}
graalvmNative {
toolchainDetection = false
binaries {
resources.autodetect()
}
}
}