citrusframework / citrus

Framework for automated integration tests with focus on messaging integration
https://citrusframework.org
Apache License 2.0
459 stars 137 forks source link

ClasspathResourceResolver unable to resolve from nested jar #1094

Closed tschlat closed 10 months ago

tschlat commented 10 months ago

Citrus Version 4.x-SNAPSHOT with Spring-Boot 3.2

Expected behavior The ClasspathResourceResolver should be able to resolve resources from nested jars. Specifically, the org.citrusframework.spi.TypeResolver, which is responsible for resolving classpath resource mappings, is failing to resolve these mappings. For example, it should be able to resolve resources located in citrus-validation-json-4.x/META-INF/citrus/variable/extractor/segment/.

Actual behavior The ClasspathResourceResolver is unable to resolve these resource mappings when packed into a Spring Boot jar archive. In this case, the containing jar is nested within the Spring Boot executable jar. It appears that there has been a change in the representation of nested jar URLs from:

jar:file:/C:/work/IdeaProjects/myProject/target/myproject-1.0.0-SNAPSHOT-executable.jar!/BOOT-INF/lib/citrus-validation-json-4.0.2.jar!/META-INF/citrus/variable/extractor/segment/ to jar:nested:/C:/work/IdeaProjects/myProject/target/myproject-1.0.0-SNAPSHOT-executable.jar!/BOOT-INF/lib/citrus-validation-json-4.0.2.jar!/META-INF/citrus/variable/extractor/segment/

And jar:nested is not properly handled by the Citrus ClasspathResourceResolver.

This change in Spring Boot from 3.1.x to 3.2.x aligns with the documentation:

Spring Boot 3.1.x Documentation Spring Boot 3.2.x Documentation

bbortt commented 10 months ago

@christophd detected by @postfinance in (company-internal) release candidate for 4.1.0. should be fixed before the release, I think.

bbortt commented 10 months ago

is also mentioned in the release notes.. advantage of those who can read.. (note to myself) 😉

https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.2-Release-Notes#nested-jar-support