-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find features on classpath inside Spring Boot 3.2.0 uberjar #2828
Comments
Interesting. The changelog states that:
But looking at the tests I wrote for this, I would expect the original to be |
Looking at this part of the stack trace
It looks like Spring Boot 3.2 provides its own file system for handling Because I don't think the current check is very robust:
|
I'm using the following in #2829
It works, but I don't know if this is the robustness you're looking for. |
I was thinking about something more robust indeed. Your pull request made me realize that the current URI parsing is incorrect. The jar uri format is:
And being a recursive format, the current implementation will never parse it correctly. So while checking for That said, I found this "specification" on https://www.iana.org/assignments/uri-schemes/prov/jar, I'd really like a more authoritative specification. 😄 |
Spring Boot 3.2 changed the URL format of their nested jars[1] to be more compliant with JDK expectations. They now represented nested jars as their own `nested` scheme rather than the `file` scheme. This allows these URLs to be used seamlessly with `FileSystems.newFileSystem`. Unfortunately the workarounds for Spring Boot 3.1 did not account for this. Additionally, our jar uri parsing assumed naively that there would only be a single `!/` in a regular jar uri. However, jar uris are recursively defined as[2]: ``` jar:<url>!/[<entry>] ``` And while this should allow Cucumber to discover resources in nested jars as well it does seem that Spring Boot 3.2 still has some issues[3]. Closes: #2828 1. https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.2-Release-Notes 2. https://www.iana.org/assignments/uri-schemes/prov/jar 3. spring-projects/spring-boot#38595
Okay. I think I've got something I'm reasonably happy with. I appreciate the reproducer, having that saved a lot of time. Though it is nothing though that actually scanning nested jars in Spring still doesn't work. But that seems to be on Spring Boots end. Scanning regular files works with this fix. |
Spring Boot 3.2 changed the URL format of their nested jars[1] to be more compliant with JDK expectations. They now represented nested jars as their own `nested` scheme rather than the `file` scheme. This allows these URLs to be used seamlessly with `FileSystems.newFileSystem`. Unfortunately the workarounds for Spring Boot 3.1 did not account for this. Additionally, our jar uri parsing assumed naively that there would only be a single `!/` in a regular jar uri. However, jar uris are recursively defined as[2]: ``` jar:<url>!/[<entry>] ``` And while this should allow Cucumber to discover resources in nested jars as well it does seem that Spring Boot 3.2 still has some issues[3]. Closes: #2828 1. https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.2-Release-Notes 2. https://www.iana.org/assignments/uri-schemes/prov/jar 3. spring-projects/spring-boot#38595
Spring Boot 3.2 changed the URL format of their nested jars[1] to be more compliant with JDK expectations. They now represented nested jars as their own `nested` scheme rather than the `file` scheme. This allows these URLs to be used seamlessly with `FileSystems.newFileSystem`. Unfortunately the workarounds for Spring Boot 3.1 did not account for this. Additionally, our jar uri parsing assumed naively that there would only be a single `!/` in a regular jar uri. However, jar uris are recursively defined as[2]: ``` jar:<url>!/[<entry>] ``` And while this should allow Cucumber to discover resources in nested jars as well it does seem that Spring Boot 3.2 still has some issues[3]. Closes: #2828 1. https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.2-Release-Notes 2. https://www.iana.org/assignments/uri-schemes/prov/jar 3. spring-projects/spring-boot#38595
👓 What did you see?
When trying to execute features inside a Spring Boot 3.2.0 application packaged as an uberjar, the following error is shown.
✅ What did you expect to see?
I expect the features to be executed and to see the output of the pretty plugin.
📦 Which tool/library version are you using?
I'm using Cucumber 7.14.1 in combination with Spring Boot 3.2.0.
🔬 How could we reproduce it?
I've created a minimal reproducible example: https://github.com/ljpengelen/cucumber-spring-boot-3.2.0
The README.md documents the steps required to reproduce the issue.
📚 Any additional context?
The problem is caused by recent changes to the code that supports Spring Boot's uberjar loading: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.2-Release-Notes.
This text was originally generated from a template, then edited by hand. You can modify the template here.
The text was updated successfully, but these errors were encountered: