Maven - Online Quiz


Advertisements


Following quiz provides Multiple Choice Questions (MCQs) related to Maven. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 1 - 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 2 - 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 3 - Which of the following phase in maven life cycle is done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects?

A - integration-test

B - verify

C - install

D - deploy

Answer : D

Explanation

deploy phase is done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.

Q 4 - Using which of the following way, you can activate a Maven Build Profile?

A - OS Settings (for example, Windows family).

B - Present/missing files.

C - Both of the above.

D - None of the above.

Answer : C

Explanation

Using both of the above ways, you can activate a Maven Build Profile.

Answer : A

Explanation

It is developer's own custom repository containing required libraries or other project jars.

Q 6 - Which of the following scope is only used when dependency is of type pom?

A - system

B - import

C - runtime

D - test

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 - What is the value for packaging element in pom for a project that is purely meta-data?

A - ear

B - war

C - jar

D - pom

Answer : D

Explanation

pom is the value for packaging element in pom for a project that is purely meta-data.

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

A - process-classes

B - process-test-sources

C - process-test-classes

D - None of the above.

Answer : A

Explanation

process-classes post-processes the generated files from compilation, for example to do bytecode enhancement/optimization on Java classes.

Q 10 - When Maven starts looking for dependency libraries, it first searches dependency in local repository.

A - true

B - false

Answer : A

Explanation

When Maven starts looking for dependency libraries, it first searches dependency in local repository.


maven_questions_answers.htm

Advertisements