Bird
0
0

You want to add a new configuration file for your Spring Boot app that should be packaged inside the jar and accessible at runtime. Where should you place this file?

hard📝 Application Q15 of 15
Spring Boot - Fundamentals
You want to add a new configuration file for your Spring Boot app that should be packaged inside the jar and accessible at runtime. Where should you place this file?
Asrc/main/resources/config
Bsrc/main/java/config
Csrc/test/resources/config
Dsrc/main/resources/static
Step-by-Step Solution
Solution:
  1. Step 1: Understand resource packaging in Spring Boot

    Files in src/main/resources are packaged inside the jar and available at runtime.
  2. Step 2: Choose correct folder for config files

    Config files should be under src/main/resources/config to be included and organized.
  3. Final Answer:

    src/main/resources/config -> Option A
  4. Quick Check:

    Runtime config files go in src/main/resources [OK]
Quick Trick: Put runtime config files in src/main/resources folder [OK]
Common Mistakes:
  • Placing config files in src/main/java which is for code
  • Using test resources folder which is not packaged
  • Putting config in static folder meant for web assets

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes