0
0
Spring Bootframework~10 mins

POM.xml and dependencies in Spring Boot - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the packaging type in a POM.xml file.

Spring Boot
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.example</groupId>
  <artifactId>demo</artifactId>
  <version>1.0.0</version>
  <packaging>[1]</packaging>
</project>
Drag options to blanks, or click blank then click option'
Ajar
Bexe
Czip
Dbin
Attempts:
3 left
💡 Hint
Common Mistakes
Using unsupported packaging types like exe or zip.
Leaving the packaging tag empty.
2fill in blank
medium

Complete the code to add the Spring Boot starter web dependency in POM.xml.

Spring Boot
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>[1]</artifactId>
  <version>3.0.0</version>
</dependency>
Drag options to blanks, or click blank then click option'
Aspring-boot-starter-web
Bspring-boot-starter-data-jpa
Cspring-boot-starter-security
Dspring-boot-starter-test
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a starter for database or security instead of web.
Forgetting to specify the artifactId.
3fill in blank
hard

Fix the error in the dependency declaration by completing the missing tag.

Spring Boot
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-data-jpa</artifactId>
  [1]
</dependency>
Drag options to blanks, or click blank then click option'
A<type>jar</type>
B<scope>compile</scope>
C<optional>true</optional>
D<version>3.0.0</version>
Attempts:
3 left
💡 Hint
Common Mistakes
Using <scope> instead of <version> when version is missing.
Omitting the version tag entirely.
4fill in blank
hard

Fill both blanks to add a dependency with groupId and artifactId correctly.

Spring Boot
<dependency>
  <groupId>[1]</groupId>
  <artifactId>[2]</artifactId>
</dependency>
Drag options to blanks, or click blank then click option'
Aorg.springframework.boot
Borg.apache.commons
Cspring-boot-starter-security
Dcommons-lang3
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing groupId and artifactId values.
Using unrelated groupId with a Spring Boot artifactId.
5fill in blank
hard

Fill all three blanks to create a dependency with groupId, artifactId, and version.

Spring Boot
<dependency>
  <groupId>[1]</groupId>
  <artifactId>[2]</artifactId>
  <version>[3]</version>
</dependency>
Drag options to blanks, or click blank then click option'
Aorg.projectlombok
Blombok
C1.18.26
D2.0.0
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect version numbers.
Swapping artifactId and groupId.