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

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.

Answer : A

Explanation

clean: cleans up artifacts created by prior builds.

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.

Answer : C

Explanation

A repository is a place i.e. directory where all the project jars, library jar, plugins or any other project specific artifacts are stored and can be used by Maven easily.

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

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

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

Answer : D

Explanation

This repository is managed by Maven community. It is not required to be configured. It requires internet access to be searched.

maven_questions_answers.htm
Advertisements