Skip to content

fix: Load version.properties file as resource stream to fix loading when packaged as jar #1813

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

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

phipag
Copy link
Contributor

@phipag phipag commented Mar 26, 2025

Issue #, if available: #1812

Description of changes:

This PR uses getResourceAsStream() instead of getResource() to fix loading the version.properties when Powertools is used as a dependency in a packaged JAR. getResource() cannot be used because files inside a JAR are no regular files. They can only be read via streams.

Checklist

Breaking change checklist

N/A

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Contributor

💾 Artifacts Size Report

Module Version Size (KB)
powertools-core 1.20.0 9.82
powertools-serialization 1.20.0 17.84
powertools-logging 1.20.0 45.72
powertools-tracing 1.20.0 13.34
powertools-sqs 1.20.0 29.18
powertools-metrics 1.20.0 14.20
powertools-parameters 1.20.0 41.30
powertools-validation 1.20.0 18.80
powertools-cloudformation 1.20.0 17.12
powertools-idempotency 1.20.0 43.48
powertools-large-messages 1.20.0 17.57
powertools-batch 1.20.0 16.80

@phipag
Copy link
Contributor Author

phipag commented Mar 27, 2025

@epomatti confirmed that this resolved the issue where a warning is logged for a missing version.properties file. #1809 (reply in thread)

@phipag phipag merged commit 8a898f9 into main Mar 27, 2025
14 checks passed
@phipag phipag deleted the phipag/issue1812 branch March 27, 2025 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: UserAgentConfigurator does not detect Powertools version when packaged as JAR
1 participant