Recall & Review
beginner
What is the Maven build lifecycle?
The Maven build lifecycle is a sequence of phases that define the steps to build and manage a project, such as compiling code, running tests, and packaging the application.
Click to reveal answer
beginner
Name the three main Maven build lifecycles.
The three main Maven build lifecycles are: default (handles project build and deployment), clean (cleans the project), and site (generates project documentation).
Click to reveal answer
beginner
What does the 'compile' phase do in the Maven default lifecycle?
The 'compile' phase compiles the project's source code into bytecode, preparing it for testing or packaging.
Click to reveal answer
beginner
Explain the purpose of the 'test' phase in Maven lifecycle.
The 'test' phase runs unit tests on the compiled code to verify that the code behaves as expected before packaging.
Click to reveal answer
beginner
What happens during the 'package' phase in Maven?
During the 'package' phase, Maven bundles the compiled code and resources into a distributable format like a JAR or WAR file.
Click to reveal answer
Which Maven lifecycle phase compiles the source code?
✗ Incorrect
The 'compile' phase is responsible for compiling the source code into bytecode.
What is the main purpose of the 'clean' lifecycle in Maven?
✗ Incorrect
The 'clean' lifecycle removes files generated by previous builds to ensure a fresh build.
Which phase packages the compiled code into a JAR or WAR file?
✗ Incorrect
The 'package' phase bundles the compiled code into distributable formats like JAR or WAR.
In which lifecycle phase are unit tests executed?
✗ Incorrect
Unit tests run during the 'test' phase after compilation.
What does the 'install' phase do in the Maven default lifecycle?
✗ Incorrect
The 'install' phase copies the packaged artifact to the local Maven repository for use by other projects.
Describe the main phases of the Maven default build lifecycle and their purposes.
Think about the steps from writing code to sharing the built package.
You got /5 concepts.
Explain the difference between the 'clean' and 'default' Maven lifecycles.
One prepares the project by cleaning, the other builds and deploys.
You got /2 concepts.