-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix packages not being imported for Spring Boot JARs without director…
…y entries I realized that the legacy behavior actually had an approach that could fix this, i.e. there we would not only read the classpath from the system properties, but also look through the whole context for any derivations of URLClassLoader and take those URLs. The Spring Boot ClassLoader actually gives us the hierarchical URLs in this form, i.e. it would return `jar:file:/some/path.jar!/BOOT-INF/classes!/` instead of just the root path. By fixing the search logic a little to also only consider the last separator and not the first one we can actually use the custom URL handling to again stream the entries from a Spring Boot JAR in a consistent way and find class files even if there is no directory entry for the respective package. If this change looks reasonable I would refactor the commits of the PR though to adjust the scanning behavior already in a pre-commit. Because I actually don't remember anymore why I decided to drop support for URLClassLoader analysis for any JRE > 9, AFAIR I thought it wouldn't make any difference and the URLClassLoader would lose meaning after JDK 8, but in fact it's still out there widely and this here shows clearly that it does make a difference to also include it.
- Loading branch information
1 parent
6a1fed1
commit d7714c4
Showing
6 changed files
with
28 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters