Maven - Online Quiz



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 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 : C

Explanation

site − generates site documentation for the project.

Q 3 - Which of the following phase in maven life cycle runs any checks to verify the package is valid and meets quality criteria?

A - integration-test

B - verify

C - install

D - deploy

Answer : B

Explanation

verify phase runs any checks to verify the package is valid and meets quality criteria.

Q 4 - Which of the Build Profile is defined in Maven settings xml file (%USER_HOME%/.m2/settings.xml)?

A - Per Project

B - Per User

C - Global

D - None of the above.

Answer : B

Explanation

Per User − Defined in Maven settings xml file (%USER_HOME%/.m2/settings.xml).

Q 5 - Which of the following scope indicates that dependency is available in classpath of project?

A - compile

B - provided

C - runtime

D - test

Answer : A

Explanation

compile − This scope indicates that dependency is available in classpath of project. It is default scope.

Q 6 - Which of the following scope is the default scope?

A - compile

B - provided

C - runtime

D - test

Answer : A

Explanation

compile − This scope indicates that dependency is available in classpath of project. It is default scope.

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.

Q 8 - Which of the following command can be used to look at the default configurations of the super POM?

A - mvn help:effective-pom

B - mvn help

C - mvn help:super-pom

D - None of the above.

Answer : A

Explanation

mvn help − effective-pom command can be used to look at the default configurations of the super POM.

Q 9 - Which of the following phase in maven life cycle copies and processes the resources into the destination directory, ready for packaging phase?

A - process-sources

B - process-resources

C - process-test-sources

D - None of the above.

Answer : B

Explanation

process-resources copies and processes the resources into the destination directory, ready for packaging phase.

Answer : D

Explanation

Maven plugins are used to do all of the above mentioned tasks.

maven_questions_answers.htm
Advertisements