- Maven Tutorial
- Maven - Home
- Maven - Overview
- Maven - Environment Setup
- Maven - POM
- Maven - Build Life Cycle
- Maven - Build Profiles
- Maven - Repositories
- Maven - Plug-ins
- Maven - Creating Project
- Maven - Build & Test Project
- Maven - External Dependencies
- Maven - Project Documents
- Maven - Project Templates
- Maven - Snapshots
- Maven - Build Automation
- Maven - Manage Dependencies
- Maven - Deployment Automation
- Maven - Web Application
- Maven - Eclipse IDE
- Maven - NetBeans
- Maven - IntelliJ IDEA
- Maven Useful Resources
- Maven - Questions and Answers
- Maven - Quick Guide
- Maven - Useful Resources
- Maven - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Maven - Mock Test
This section presents you various set of Mock Tests related to Maven. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
Maven Mock Test I
Q 1 - Which of the following is true about Maven?
A - Maven is a project management and comprehension tool.
B - Maven provides developers a complete build lifecycle framework.
Answer : C
Explanation
Maven is a project management and comprehension tool. Maven provides developers a complete build lifecycle framework.
Q 2 - Which of the following is true about Maven?
A - Development team can automate the project's build infrastructure in almost no time using Maven.
B - Maven uses a standard directory layout and a default build lifecycle.
Answer : C
Explanation
Development team can automate the project's build infrastructure in almost no time as Maven uses a standard directory layout and a default build lifecycle.
Q 3 - Which of the following is true about Maven Conventions?
B - Developers using maven do not have to mention each and every configuration details.
Answer : C
Explanation
Maven uses Convention over Configuration which means developers are not required to create build process themselves. Developers do not have to mention each and every configuration details.
Q 4 - Which of the following aspects of a project can be managed using Maven?
Answer : D
Explanation
All of the above aspects of a project can be managed using Maven.
Q 5 - Which of the following aspects of a project can be managed using Maven?
Answer : D
Explanation
All of the above aspects of a project can be managed using Maven.
Q 6 - Which of the following aspects of a project can be managed using Maven?
Answer : C
Explanation
Both of the above aspects of a project can be managed using Maven.
Q 7 - Which of the following command can tell the version of maven?
Answer : A
Explanation
mvn --version tells the version of maven.
Q 8 - What POM stands for?
Answer : B
Explanation
POM stands for Project Object Model.
Q 9 - What of the following is true about POM?
Answer : C
Explanation
POM stands for Project Object Model. It is fundamental Unit of Work in Maven. It is an XML file.
Q 10 - What of the following is true about POM?
A - It always resides in the base directory of the project as pom.xml.
Answer : C
Explanation
POM contains information about the project and various configuration details used by Maven to build the project(s) and it always resides in the base directory of the project as pom.xml.
Q 11 - Which of the following configuration element is present in POM.xml?
Answer : D
Explanation
All of the above configuration elements are present in POM.xml.
Q 12 - Which of the following configuration element is present in POM.xml?
Answer : C
Explanation
Both of the above configuration elements are present in POM.xml.
Q 13 - Which of the following configuration element is present in POM.xml?
Answer : C
Explanation
Both of the above configuration elements are present in POM.xml.
Q 14 - Which of the following is true about maven artifact?
A - A maven artifact is a file, usually a JAR that gets deployed to a Maven repository.
B - A Maven build produces one or more artifacts, such as a compiled JAR and a 'sources' JAR.
Answer : C
Explanation
A maven artifact is a file, usually a JAR that gets deployed to a Maven repository. A Maven build produces one or more artifacts, such as a compiled JAR and a 'sources' JAR.
Q 15 - Which of the following is true about maven artifact?
A - Each artifact has a group ID, an artifact ID (just a name), and a version string.
B - The group ID,artifact ID and version together uniquely identify the artifact.
Answer : D
Explanation
Each artifact has a group ID (usually a reversed domain name, like com.example.foo), an artifact ID (just a name), and a version string. The three together uniquely identify the artifact. A project's dependencies are specified as artifacts.
Q 16 - Which of the following is true about Maven Build Lifecycle?
Answer : C
Explanation
A Build Lifecycle is a well defined sequence of phases which define the order in which the goals are to be executed. Here phase represents a stage in life cycle.
Q 17 - Which of the following is true about 'clean' Maven life cycle?
A - It cleans up artifacts created by prior builds.
B - This is used to build the application.
Answer : A
Explanation
clean: cleans up artifacts created by prior builds.
Q 18 - Which of the following is true about 'build' Maven life cycle?
A - It cleans up artifacts created by prior builds.
B - This is used to build the application.
Answer : B
Explanation
default (or build) − This is used to build the application.
Q 19 - Which of the following is true about 'site' Maven life cycle?
A - It cleans up artifacts created by prior builds.
B - This is used to build the application.
Answer : C
Explanation
site − generates site documentation for the project.
Q 20 - Which of the following command removes the target directory with all the build data before starting the build process?
Answer : A
Explanation
mvn clean command removes the target directory with all the build data before starting the build process.
Q 21 - Which of the following command quickly builds Maven site?
Answer : D
Explanation
mvn site command can quickly builds Maven site.
Q 22 - Which of the following phase in maven life cycle validates that the project is correct and all necessary information is available?
Answer : A
Explanation
validate phase validates that the project is correct and all necessary information is available.
Q 23 - Which of the following phase in maven life cycle compiles the source code of the project?
Answer : B
Explanation
compile phase compile the source code of the project.
Q 24 - Which of the following phase in maven life cycle tests the compiled source code using a suitable unit testing framework?
Answer : C
Explanation
test phase tests the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed.
Q 25 - Which of the following phase in maven life cycle takes the compiled code and package it in its distributable format, such as a JAR?
Answer : D
Explanation
package phase takes the compiled code and package it in its distributable format, such as a JAR.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | C |
2 | C |
3 | C |
4 | D |
5 | D |
6 | C |
7 | A |
8 | B |
9 | C |
10 | C |
11 | D |
12 | C |
13 | C |
14 | C |
15 | D |
16 | C |
17 | A |
18 | B |
19 | C |
20 | A |
21 | D |
22 | A |
23 | B |
24 | C |
25 | D |