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]
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 directoryWhat is happening
java.lang.ClassLoader#getResources(String)returns an empty EnumerationSteps to reproduce
Here an example project reproducing the issue
App.java