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

Answer : B

Explanation

default (or build) − This is used to build the application.

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

Answer : C

Explanation

SNAPSHOT is a special version that indicates a current development copy. Unlike regular versions, Maven checks for a new SNAPSHOT version in a remote repository for every build.

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

Explanation

When a Maven project is created, Maven creates default project structure. Developer is only required to place files accordingly and he/she need not to define any configuration in pom.xml.

Q 8 - Which of the following phase in maven life cycle generates any source code to be included in compilation phase?

A - generate-sources

B - generate-resources

C - generate-test-sources

D - None of the above.

Answer : A

Explanation

generate-sources generates any source code to be included in compilation phase.

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