- 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 IV
Q 1 - Which of the following is correct about super POM?
A - All POMs inherit from a parent (despite explicitly defined or not) known as super POM.
Answer : C
Explanation
All POMs inherit from a parent (despite explicitly defined or not). This base POM is known as the Super POM, and contains values inherited by default.
Q 2 - Which of the following is correct about super POM?
Answer : C
Explanation
Maven use the effective pom (configuration from super pom plus project configuration) to execute relevant goal. It helps developer to specify minimum configuration detail in his/her pom.xml. Although configurations can be overridden easily.
Q 3 - Which of the following command can be used to look at the default configurations of the super POM?
Answer : A
Explanation
mvn help − effective-pom command can be used to look at the default configurations of the super POM.
Q 4 - Which of the following is correct about Goal in Maven?
A - A goal represents a specific task which contributes to the building and managing of a project.
Answer : D
Explanation
A goal represents a specific task which contributes to the building and managing of a project. It may be bound to zero or more build phases. A goal not bound to any build phase could be executed outside of the build lifecycle by direct invocation.
Q 5 - Which of the following phase in maven life cycle generates any source code to be included in compilation phase?
Answer : A
Explanation
generate-sources generates any source code to be included in compilation phase.
Q 6 - Which of the following phase in maven life cycle processes the source code, for example, filter any value?
Answer : B
Explanation
process-sources processes the source code, for example, filter any value.
Q 7 - Which of the following phase in maven life cycle generates resources to be included in the package?
Answer : A
Explanation
generate-resources generates resources to be included in the package.
Q 8 - Which of the following phase in maven life cycle copies and processes the resources into the destination directory, ready for packaging phase?
Answer : B
Explanation
process-resources copies and processes the resources into the destination directory, ready for packaging phase.
Q 9 - Which of the following phase in maven life cycle post-processes the generated files from compilation, for example to do bytecode enhancement/optimization on Java classes?
Answer : A
Explanation
process-classes post-processes the generated files from compilation, for example to do bytecode enhancement/optimization on Java classes.
Q 10 - Which of the following phase in maven life cycle generates any test source code to be included in compilation phase?
Answer : C
Explanation
generate-test-sources generates any test source code to be included in compilation phase.
Q 11 - Which of the following phase in maven life cycle processes the test source code, for example, filter any values?
Answer : B
Explanation
process-test-sources processes the test source code, for example, filter any values.
Q 12 - Which of the following phase in maven life cycle compiles the test source code into the test destination directory?
Answer : A
Explanation
test-compile compiles the test source code into the test destination directory.
Q 13 - Which of the following phase in maven life cycle processes the generated files from test code file compilation?
Answer : A
Explanation
process-test-classes processes the generated files from test code file compilation.
Q 14 - Which of the following phase in maven life cycle performs any operations necessary to prepare a package before the actual packaging?
Answer : C
Explanation
prepare-package performs any operations necessary to prepare a package before the actual packaging.
Q 15 - Which of the following phase in maven life cycle performs actions required before integration tests are executed. For example, setting up the required environment?
Answer : B
Explanation
pre-integration-test performs actions required before integration tests are executed. For example, setting up the required environment.
Q 16 - Which of the following phase in maven life cycle processes and deploys the package if necessary into an environment where integration tests can be run?
Answer : C
Explanation
integration-test processes and deploys the package if necessary into an environment where integration tests can be run.
Q 17 - Which of the following phase in maven life cycle performs actions required after integration tests have been executed? For example, cleaning up the environment.
Answer : A
Explanation
post-integration-test performs actions required after integration tests have been executed. For example, cleaning up the environment.
Q 18 - Which of the following is true about Maven central repository?
A - This repository is managed by Maven community.
B - It is not required to be configured.
Answer : D
Explanation
This repository is managed by Maven community. It is not required to be configured. It requires internet access to be searched.
Q 19 - Which of the following plugin run the JUnit unit tests and creates test reports?
Answer : A
Explanation
surefire plugin run the JUnit unit tests and creates test reports.
Q 20 - When Maven starts looking for dependency libraries, it first searches dependency in local repository.
Answer : A
Explanation
When Maven starts looking for dependency libraries, it first searches dependency in local repository.
Q 21 - When dependency in local repository is not found, then Maven searches dependency in central repository.
Answer : A
Explanation
Maven searches dependency in central repository, if not found and remote repository/repositories is/are mentioned then searches in remote repositories else if found, then it is downloaded to local repository for future reference.
Q 22 - When dependency in central repository is not found, then Maven searches dependency in remote repository.
Answer : A
Explanation
Maven searches dependency in remote repository or repositories, if found then it is downloaded to local repository for future reference otherwise Maven as expected stop processing and throws error (Unable to find dependency).
Q 23 - Maven Plugins are generally used to:
Answer : D
Explanation
Maven plugins are used to do all of the above mentioned tasks.
Q 24 - Maven Plugins are generally used to:
Answer : C
Explanation
Maven plugins are used to do both of the above mentioned tasks.
Q 25 - Maven Plugins are generally used to:
Answer : C
Explanation
Maven plugins are used to do both of the above mentioned tasks.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | C |
2 | C |
3 | A |
4 | D |
5 | A |
6 | B |
7 | A |
8 | B |
9 | A |
10 | C |
11 | B |
12 | A |
13 | A |
14 | C |
15 | B |
16 | C |
17 | A |
18 | D |
19 | A |
20 | A |
21 | A |
22 | A |
23 | D |
24 | C |
25 | C |