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

POM contains information about the project and various configuration details used by Maven to build the project(s) and it always resides in the base directory of the project as pom.xml.

Answer : C

Explanation

A Build Lifecycle is a well defined sequence of phases which define the order in which the goals are to be executed. Here phase represents a stage in life cycle.

Q 3 - Which of the following phase in maven life cycle processes and deploys the package if necessary into an environment where integration tests can be run?

A - integration-test

B - verify

C - install

D - deploy

Answer : A

Explanation

integration-test phase processes and deploys the package if necessary into an environment where integration tests can be run.

Q 4 - Which of the following is a valid type of Maven repository?

A - local

B - central

C - remote

D - All of the above.

Answer : D

Explanation

Maven repository are of three types: local, central, remote.

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 refers to the version of the project?

A - ${pom.version}

B - ${project.version}

C - ${maven.version}

D - ${version}

Answer : A

Explanation

${pom.version} refers to the version of the project.

Q 7 - What is the value for packaging element in pom for a project that is purely meta-data?

A - ear

B - war

C - jar

D - pom

Answer : D

Explanation

pom is the value for packaging element in pom for a project that is purely meta-data.

Answer : D

Explanation

A goal represents a specific task which contributes to the building and managing of a project. It may be bound to zero or more build phases. A goal not bound to any build phase could be executed outside of the build lifecycle by direct invocation.

Q 9 - Which of the following phase in maven life cycle processes the generated files from test code file compilation?

A - process-test-classes

B - process-test-sources

C - generate-test-sources

D - None of the above.

Answer : A

Explanation

process-test-classes processes the generated files from test code file compilation.

Q 10 - When dependency in local repository is not found, then Maven searches dependency in central repository.

A - true

B - false

Answer : A

Explanation

Maven searches dependency in central repository, if not found and remote repository/repositories is/are mentioned then searches in remote repositories else if found, then it is downloaded to local repository for future reference.

maven_questions_answers.htm
Advertisements