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 command can tell the version of maven?

A - mvn --version

B - maven -version

C - mvn version

D - maven --version

Answer : A

Explanation

mvn --version tells the version of maven.

Answer : A

Explanation

clean: cleans up artifacts created by prior builds.

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.

Answer : D

Explanation

Using all of the above ways, you can activate a Maven Build Profile.

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 - All POM files require the project element and three mandatory fields: groupId, artifactId,version.

A - false

B - true

Answer : B

Explanation

All POM files require the project element and three mandatory fields: groupId, artifactId,version.

Q 8 - Projects notation in repository is groupId:artifactId:version.

A - false

B - true

Answer : B

Explanation

Projects notation in repository is groupId:artifactId:version.

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

Explanation

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


maven_questions_answers.htm

Advertisements