-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Context
I'm using embedded flyway to automatically migrate my database scripts and it solves directories on classpath to load sql files
What is expected
java.lang.ClassLoader#getResources(String)
returns the URL for the specified directory
What is happening
java.lang.ClassLoader#getResources(String)
returns an empty Enumeration
Steps to reproduce
Here an example project reproducing the issue
App.java
public static void main(String[] args) throws Exception {
System.out.println(getResources("folder/subfolder"));
System.out.println(getResources("folder/subfolder/resource-001.txt"));
}
public static List<URL> getResources(String name) throws IOException {
final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
return Collections.list(classLoader.getResources(name));
}
$ ./gradlew clean build nativeImage && ./build/graal/resources-resolution
[]
[resource:folder/subfolder/resource-001.txt]
sbrannenkazuki43zoo, guanchao-yang, adamzr, gudaoxuri, rdehuyss and 6 more