[MAGNOLIA-7601] ClasspathResourcesUtil refactoring Created: 12/Aug/19 Updated: 29/Oct/21 Resolved: 28/Sep/21 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.2.13 |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Mercedes Iruela | Assignee: | Michael Duerig |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Template: |
|
||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||
| Task DoD: |
[X]*
Doc/release notes changes? Comment present?
[X]*
Downstream builds green?
[X]*
Solution information and context easily available?
[X]*
Tests
[X]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||||||
| Date of First Response: | |||||||||||||
| Epic Link: | Build on JDK11+ | ||||||||||||
| Description |
|
ClasspathResourcesUtil may not collect the expected resources on Java 9+. Since JDK9, the system class loaders are no longer URLClassLoaders. This becomes a problem when running tests or scripts standalone on Java 11 for example (either from Maven or from IntelliJ). It is not a problem at Magnolia runtime because there we are under Tomcat's WebappClassLoader (or similar for others) which still is a URLClassLoader. Fix should be along the lines of tokenizing the classpath and producing URLs out of that, no unsafe reflection involved. |
| Comments |
| Comment by Michael Duerig [ 27/Sep/21 ] |
|
Resources are made available for running tests by scanning the individual class path entries should the class loader not be an instance of URLClassLoader |