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 aspects of a project can be managed using Maven?

A - Builds

B - Documentation

C - Reporting

D - All of the above.

Answer : D

Explanation

All of the above aspects of a project can be managed using Maven.

Answer : C

Explanation

A maven artifact is a file, usually a JAR that gets deployed to a Maven repository. A Maven build produces one or more artifacts, such as a compiled JAR and a 'sources' JAR.

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

Maven will automatically fetch the latest SNAPSHOT everytime dependent project is built. Unlike regular versions, Maven checks for a new SNAPSHOT version in a remote repository for every build.

Q 6 - Which of the following scope indicates that dependency is to be provided by JDK or web-Server/Container at runtime?

A - compile

B - provided

C - runtime

D - test

Answer : B

Explanation

provided − This scope indicates that dependency is to be provided by JDK or web-Server/Container at runtime.

Answer : C

Explanation

Maven provides a comprehensive model for projects which is reusable, maintainable, and easier to comprehend and provides plugins or tools that interact with its declarative model.

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 compiles the test source code into the test destination directory?

A - test-compile

B - process-test-sources

C - generate-test-sources

D - None of the above.

Answer : A

Explanation

test-compile compiles the test source code into the test destination directory.

Q 10 - Which of the following phase in maven life cycle performs actions required after integration tests have been executed? For example, cleaning up the environment.

A - post-integration-test

B - pre-integration-test

C - integration-test

D - None of the above.

Answer : A

Explanation

post-integration-test performs actions required after integration tests have been executed. For example, cleaning up the environment.

maven_questions_answers.htm
Advertisements