- 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
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 III
Q 1 - Which of the following scope is the default scope?
Answer : A
Explanation
compile − This scope indicates that dependency is available in classpath of project. It is default scope.
Q 2 - Which of the following scope indicates that dependency is to be provided by JDK or web-Server/Container at runtime?
Answer : B
Explanation
provided − This scope indicates that dependency is to be provided by JDK or web-Server/Container at runtime.
Q 3 - Which of the following scope indicates that dependency is not required for compilation, but is required during execution?
Answer : C
Explanation
runtime − This scope indicates that dependency is not required for compilation, but is required during execution.
Q 4 - Which of the following scope indicates that the dependency is only available for the test compilation and execution phases?
Answer : D
Explanation
test − This scope indicates that the dependency is only available for the test compilation and execution phases.
Q 5 - Which of the following scope indicates that you have to provide the system path?
Answer : A
Explanation
system − This scope indicates that you have to provide the system path.
Q 6 - Which of the following scope is only used when dependency is of type pom?
Answer : B
Explanation
import: This scope is only used when dependency is of type pom. This scope indicates that the specified POM should be replaced with the dependencies in that POM's <dependencyManagement> section.
Q 7 - Which of the following refers to the name of the project?
Answer : A
Explanation
${pom.name} refers to the name of the project.
Q 8 - Which of the following refers to the version of the project?
Answer : A
Explanation
${pom.version} refers to the version of the project.
Q 9 - Which of the following refers to the final name of the file created when the built project is packaged?
Answer : A
Explanation
${pom.build.finalName} refers to the final name of the file created when the built project is packaged.
Answer : C
Explanation
If no packaging value has been specified, it will default to jar.
Q 11 - What is the value for packaging element in pom for a project that is purely meta-data?
Answer : D
Explanation
pom is the value for packaging element in pom for a project that is purely meta-data.
Q 12 - What is the use of execution element in pom file?
A - The <execution> element contains information's required for the execution of a plugin.
B - The <execution> element contains information's required for the execution of a project.
Answer : A
Explanation
The <execution> element contains information's required for the execution of a plugin.
Q 13 - What MOJO stands for?
A - Main plain Old Java Object
B - Maven plain Old Java Object
Answer : B
Explanation
A mojo is a Maven plain Old Java Object.
Q 14 - Which of the following is true about MOJO?
A - A mojo is a Maven plain Old Java Object.
B - Each mojo is an executable goal in Maven.
C - A plugin is a distribution of one or more related mojos.
Answer : D
Explanation
A mojo is a Maven plain Old Java Object. Each mojo is an executable goal in Maven, and a plugin is a distribution of one or more related mojos.
Answer : A
Explanation
Apache Maven is a software project management and comprehension tool.
Q 16 - Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.
Answer : A
Explanation
Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.
Q 17 - Which of the following is true about Maven?
B - Maven provides plugins or tools that interact with its declarative model.
Answer : C
Explanation
Maven provides a comprehensive model for projects which is reusable, maintainable, and easier to comprehend and provides plugins or tools that interact with its declarative model.
Q 18 - Which of the following is true about Maven?
A - When a Maven project is created, Maven creates default project structure.
Answer : C
Explanation
When a Maven project is created, Maven creates default project structure. Developer is only required to place files accordingly and he/she need not to define any configuration in pom.xml.
Answer : A
Explanation
There should be a single POM file for each project.
Q 20 - All POM files require the project element and three mandatory fields: groupId, artifactId,version.
Answer : B
Explanation
All POM files require the project element and three mandatory fields: groupId, artifactId,version.
Answer : B
Explanation
Projects notation in repository is groupId:artifactId:version.
Answer : A
Explanation
Root element of POM.xml is project.
Q 23 - Which of the following is correct about groupId in Maven pom.xml?
A - This is an Id of project's group.
B - This is generally unique amongst an organization or a project.
Answer : C
Explanation
This is an Id of project's group. This is generally unique amongst an organization or a project. For example, a banking group com.company.bank has all bank related projects.
Q 24 - Which of the following is correct about artifactId in Maven pom.xml?
A - This is an Id of the project.
Answer : C
Explanation
This is an Id of the project.This is generally name of the project. For example, consumer-banking. Along with the groupId, the artifactId defines the artifact's location within the repository.
Q 25 - Which of the following is correct about version in Maven pom.xml?
Answer : C
Explanation
This is the version of the project.Along with the groupId, It is used within an artifact's repository to separate versions from each other. For example: com.company.bank:consumer-banking:1.0, com.company.bank:consumer-banking:1.1.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | A |
2 | B |
3 | C |
4 | D |
5 | A |
6 | B |
7 | A |
8 | A |
9 | A |
10 | C |
11 | D |
12 | A |
13 | B |
14 | D |
15 | A |
16 | A |
17 | C |
18 | C |
19 | A |
20 | B |
21 | B |
22 | A |
23 | C |
24 | C |
25 | C |