Version
io.vertx:vertx-core:4.5.30
Context
When using Vertx, with PemTrustOptions for example, during the execution of the code, Vertx tries to load all the application properties from the quarkus classpath using the FileResolverImpl.
When this file is an absolute path reference, an exception is thrown. When a relative file is used, it works, but will represent other issues in the code.
Refering to line 147
This method also scans the entire classloader and starts to resolve all files.
But the resolve will generate an incorrect subResource reference in line 267
Steps to reproduce
(minimal DemoResolve project in attachment demoResolve.zip)
- Project containing only 1 resource file
application.yml in src/main/resources
- Test containing 1
@QuarkusTest
- The test will try to resolve the (absolute)
/application.yml file
- Run test > gives exception
When changing
fileResolver.resolveFile("/application.yml");
to
fileResolver.resolveFile("application.yml");
it does not give an exception.
Problem lies in the fact that in this example, QuarkusTest writes an empty application.properties to a temp workfolder (e.g. %TEMP%/startup-override9955225914473382599)
The absolutePath will then find the startup folder (url) but reference is with a fileName '/' instead of url.getPath() which results in:
//application.properties > does not exist
instead of
%TEMP%/startup-override9955225914473382599/application.properties
Do you have a reproducer?
No response
Version
io.vertx:vertx-core:4.5.30
Context
When using Vertx, with PemTrustOptions for example, during the execution of the code, Vertx tries to load all the application properties from the quarkus classpath using the FileResolverImpl.
When this file is an absolute path reference, an exception is thrown. When a relative file is used, it works, but will represent other issues in the code.
Refering to line 147
This method also scans the entire classloader and starts to resolve all files.
But the resolve will generate an incorrect
subResourcereference in line 267Steps to reproduce
(minimal DemoResolve project in attachment demoResolve.zip)
application.ymlinsrc/main/resources@QuarkusTest/application.ymlfileWhen changing
fileResolver.resolveFile("/application.yml");to
fileResolver.resolveFile("application.yml");it does not give an exception.
Problem lies in the fact that in this example, QuarkusTest writes an empty application.properties to a temp workfolder (e.g.
%TEMP%/startup-override9955225914473382599)The absolutePath will then find the startup folder (url) but reference is with a fileName '/' instead of
url.getPath()which results in://application.properties> does not existinstead of
%TEMP%/startup-override9955225914473382599/application.propertiesDo you have a reproducer?
No response