0
0
JUnittesting~5 mins

Maven dependency setup in JUnit - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Maven dependency?
A Maven dependency is a library or tool your project needs to work. Maven downloads and manages these automatically for you.
Click to reveal answer
beginner
Where do you add dependencies in a Maven project?
You add dependencies inside the <dependencies> section of the pom.xml file in your project.
Click to reveal answer
beginner
Show the Maven dependency snippet to add JUnit 5.
org.junit.jupiter junit-jupiter 5.10.0 test
Click to reveal answer
beginner
What does the test tag mean in a Maven dependency?
It means the dependency is only used when running tests, not in the main application.
Click to reveal answer
beginner
Why is it helpful to use Maven dependencies?
Maven downloads the right versions for you, avoids conflicts, and makes your project easy to share and build on any computer.
Click to reveal answer
Where do you add a Maven dependency?
AInside the pom.xml file
BIn the src folder
CIn the README file
DIn the .gitignore file
What does the test tag do in a Maven dependency?
ADownloads the dependency twice
BIncludes the dependency in the final build
CRemoves the dependency from the project
DMakes the dependency available only during testing
Which groupId is correct for JUnit 5 in Maven?
Aorg.junit.jupiter
Bjunit.junit
Corg.junit4
Dcom.junit
What file does Maven use to manage dependencies?
Apackage.json
Bbuild.gradle
Cpom.xml
Dsettings.xml
Why use Maven dependencies instead of manually adding jars?
AManual jars are faster
BMaven handles versions and downloads automatically
CMaven dependencies are optional
DManual jars never cause conflicts
Explain how to add JUnit 5 as a dependency in a Maven project.
Think about the XML tags and where they go in the project file.
You got /4 concepts.
    Why is managing dependencies with Maven better than adding jar files manually?
    Consider what happens when you share your project with others.
    You got /4 concepts.