0
0
Spring Bootframework~20 mins

POM.xml and dependencies in Spring Boot - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
POM.xml Dependency Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Dependency Scope in POM.xml
In a Spring Boot project, what is the effect of setting a dependency's scope to provided in the POM.xml?
AThe dependency is included in the final build artifact and available at runtime.
BThe dependency is only available during compilation but not included in the final artifact.
CThe dependency is excluded from compilation and runtime but used for testing only.
DThe dependency is downloaded but never used in the project.
Attempts:
2 left
💡 Hint
Think about dependencies provided by the runtime environment like a servlet container.
component_behavior
intermediate
2:00remaining
Effect of Missing Spring Boot Starter Dependency
What happens if you omit the spring-boot-starter-web dependency in your Spring Boot POM.xml but try to create a REST controller?
AThe application starts normally but REST endpoints return 404 errors.
BThe application starts and REST endpoints work without issues.
CThe application fails to start due to missing web server classes.
DThe application starts but logs warnings about missing dependencies.
Attempts:
2 left
💡 Hint
Consider what the starter web dependency provides.
📝 Syntax
advanced
2:00remaining
Identify the Correct Dependency Declaration
Which POM.xml dependency snippet correctly adds the Spring Boot Starter Data JPA dependency?
A
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
B
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-data-jpa</artifactId>
</dependency>
C
<dependency>
  <groupId>springframework.boot</groupId>
  <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
D
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-data-jpa</artifactId>
  <version>2.7.0</version>
</dependency>
Attempts:
2 left
💡 Hint
Check groupId spelling and if version is needed explicitly.
🔧 Debug
advanced
2:00remaining
Diagnose Dependency Conflict in POM.xml
You added two dependencies: spring-boot-starter-web and spring-boot-starter-webflux. Your app fails to start with a bean creation error. What is the likely cause?
ABoth starters provide conflicting web server implementations causing bean conflicts.
BYou forgot to add <code>spring-boot-starter-data-jpa</code> dependency.
CThe POM.xml is missing the <code>spring-boot-maven-plugin</code>.
DThe Java version is incompatible with Spring Boot starters.
Attempts:
2 left
💡 Hint
Think about the difference between traditional MVC and reactive web frameworks.
state_output
expert
2:00remaining
Resulting Dependency Tree Size
If your Spring Boot POM.xml includes only spring-boot-starter-web and spring-boot-starter-data-jpa, approximately how many direct and transitive dependencies will Maven download?
AAbout 10 dependencies total
BAbout 30 dependencies total
CMore than 100 dependencies total
DAbout 60 dependencies total
Attempts:
2 left
💡 Hint
Consider that starters bring many libraries transitively.