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.

Questions and Answers

Maven Mock Test I

Answer : C

Explanation

Maven is a project management and comprehension tool. Maven provides developers a complete build lifecycle framework.

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.

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?

A - Builds

B - Documentation

C - Reporting

D - All of the above.

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?

A - Dependencies

B - SCMs

C - Releases

D - All of the above.

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?

A - Distribution

B - mailing list

C - Both of the above.

D - None of the above.

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?

A - mvn --version

B - maven -version

C - mvn version

D - maven --version

Answer : A

Explanation

mvn --version tells the version of maven.

Answer : B

Explanation

POM stands for Project Object Model.

Answer : C

Explanation

POM stands for Project Object Model. It is fundamental Unit of Work in Maven. It is an XML file.

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?

A - project dependencies

B - plugins

C - goals

D - All of the above.

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?

A - build profiles

B - project version

C - Both of the above.

D - None of the above.

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?

A - developers

B - mailing list

C - Both of the above.

D - None of the above.

Answer : C

Explanation

Both of the above configuration elements are present in POM.xml.

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.

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.

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.

Answer : A

Explanation

clean: cleans up artifacts created by prior builds.

Answer : B

Explanation

default (or build) − 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?

A - mvn clean

B - mvn build

C - mvn compile

D - mvn site

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?

A - mvn clean

B - mvn build

C - mvn compile

D - mvn 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?

A - validate

B - compile

C - test

D - package

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?

A - validate

B - compile

C - test

D - package

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?

A - validate

B - compile

C - test

D - package

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?

A - validate

B - compile

C - test

D - package

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
maven_questions_answers.htm
Advertisements