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

Explanation

Each artifact has a group ID (usually a reversed domain name, like com.example.foo), an artifact ID (just a name), and a version string. The three together uniquely identify the artifact. A project's dependencies are specified as artifacts.

Q 3 - Which of the following phase in maven life cycle tests the compiled source code using a suitable unit testing framework?

A - validate

B - compile

C - test

D - package

Answer : C

Explanation

test phase tests the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed.

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

Explanation

Maven local repository is a folder location on your machine. It gets created when you run any maven command for the first time. Maven local repository keeps your project's all dependencies (library jars, plugin jars etc).

Q 6 - Which of the following scope indicates that the dependency is only available for the test compilation and execution phases?

A - compile

B - provided

C - runtime

D - test

Answer : D

Explanation

test − This scope indicates that the dependency is only available for the test compilation and execution phases.

Answer : A

Explanation

The <execution> element contains information's required for the execution of a plugin.

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 performs actions required before integration tests are executed. For example, setting up the required environment?

A - process-resources

B - pre-integration-test

C - prepare-package

D - None of the above.

Answer : B

Explanation

pre-integration-test performs actions required before integration tests are executed. For example, setting up the required environment.

Answer : D

Explanation

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


maven_questions_answers.htm

Advertisements