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

Q 2 - 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.

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.

Answer : D

Explanation

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

Q 5 - Which of the following maven plugin executes during the build and should be configured in the element of pom.xml?

A - Build plugins

B - Reporting plugins

C - Both of the above

D - None of the above.

Answer : A

Explanation

Build plugins − They execute during the build and should be configured in the element of pom.xml.

Q 6 - Which of the following scope indicates that dependency is not required for compilation, but is required during execution?

A - compile

B - provided

C - runtime

D - test

Answer : C

Explanation

runtime − This scope indicates that dependency is not required for compilation, but is required during execution.

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 : 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
E-Books Store