Challenge - 5 Problems
Spring Initializr Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ component_behavior
intermediate1:00remaining
What is the default packaging type when creating a Spring Boot project with Spring Initializr?
When you create a new Spring Boot project using Spring Initializr without changing any settings, what packaging type will the project use by default?
Attempts:
2 left
💡 Hint
Think about the most common way Spring Boot applications are packaged for easy execution.
✗ Incorrect
Spring Initializr defaults to jar packaging because Spring Boot applications are typically run as standalone jar files.
📝 Syntax
intermediate1:00remaining
Which dependency is required to create a REST API with Spring Initializr?
You want to create a REST API using Spring Boot. Which dependency should you select in Spring Initializr to get the necessary support?
Attempts:
2 left
💡 Hint
REST APIs need support for HTTP requests and controllers.
✗ Incorrect
The Spring Web dependency includes support for building web applications and RESTful services.
❓ state_output
advanced1:30remaining
What is the value of 'java.version' property in the generated Spring Boot project?
After generating a Spring Boot project with Spring Initializr targeting Java 17, what will be the value of the 'java.version' property in the generated pom.xml or build.gradle file?
Attempts:
2 left
💡 Hint
The Java version matches the selected target version in Spring Initializr.
✗ Incorrect
If you select Java 17 in Spring Initializr, the generated project will set java.version to 17 to ensure compatibility.
🔧 Debug
advanced2:00remaining
Why does the generated Spring Boot project fail to start after changing packaging to WAR?
You generated a Spring Boot project with Spring Initializr and changed packaging from JAR to WAR. After adding a servlet container dependency, the application fails to start with a 'No ServletContext' error. What is the most likely cause?
Attempts:
2 left
💡 Hint
WAR packaging requires special setup for servlet initialization.
✗ Incorrect
When packaging as WAR, the main class must extend SpringBootServletInitializer and override configure() to properly initialize the servlet context.
🧠 Conceptual
expert2:30remaining
Which statement about Spring Initializr's dependency management is true?
Consider how Spring Initializr manages dependencies in the generated project. Which of the following statements is correct?
Attempts:
2 left
💡 Hint
Think about how Spring Boot manages dependencies to avoid conflicts.
✗ Incorrect
Spring Initializr uses a curated set of dependency versions defined by Spring Boot to ensure all dependencies work well together.