Skip to content
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

Spring Boot application.properties is not working when building using shadowJar #873

Open
skywalker123p opened this issue Jul 1, 2023 · 1 comment

Comments

@skywalker123p
Copy link

Please check the User Guide before submitting "how do I do 'x'?" questions!

Shadow Version

7.1.2

Gradle Version

7.6

Expected Behavior

Building Spring Boot Executable Jar using shadowJar: application.properties should be used when running java -jar abcShadowJar.jar

Actual Behavior

application.properties is not recognized by Spring Boot application because its in root directory when building using shadowJar.

Gradle Build Script(s)

shadowJar {
    mergeServiceFiles()
    zip64 true
   archiveClassifier.set('standalone')
}

Content of Shadow JAR (jar tf <jar file> - post link to GIST if too long)

Simple Spring Boot web application
@BurtonAlexand14
Copy link

@propertysource("classpath:application.properties")

Include this in your configuration to force-load application.properties in a shadow jar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants