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

Answer : C

Explanation

POM stands for Project Object Model. It is fundamental Unit of Work in Maven. It is an XML file.

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 is done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects?

A - integration-test

B - verify

C - install

D - deploy

Answer : D

Explanation

deploy phase is done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.

Q 4 - Which of the following phases is present in 'site' Maven life cycle?

A - pre-site

B - site

C - site-deploy

D - All of the above.

Answer : D

Explanation

The site lifecycle consists of the following phases: 1) pre-site 2) site 3) post-site and 4) site-deploy.

Q 5 - Which of the following command can be used to create a new project based on an archtype?

A - mvn archetype:archetype

B - mvn archetype:generate

C - mvn generate:archetype

D - None of the above.

Answer : B

Explanation

mvn archetype:generate command can be used to create a new project based on an archtype.

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.

Q 7 - Apache Maven is a software project management and comprehension tool.

A - true

B - false

Answer : A

Explanation

Apache Maven is a software project management and comprehension tool.

Answer : C

Explanation

Maven use the effective pom (configuration from super pom plus project configuration) to execute relevant goal. It helps developer to specify minimum configuration detail in his/her pom.xml. Although configurations can be overridden easily.

Q 9 - Which of the following phase in maven life cycle processes the test source code, for example, filter any values?

A - process-classes

B - process-test-sources

C - generate-test-sources

D - None of the above.

Answer : B

Explanation

process-test-sources processes the test source code, for example, filter any values.

Answer : C

Explanation

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

maven_questions_answers.htm
Advertisements