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 : 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 installs the package into the local repository, for use as a dependency in other projects locally?

A - integration-test

B - verify

C - install

D - deploy

Answer : C

Explanation

install phase installs the package into the local repository, for use as a dependency in other projects locally.

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.

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 is the default value of packaging?

A - ear

B - war

C - jar

D - pom

Answer : C

Explanation

If no packaging value has been specified, it will default to jar.

Q 7 - There should be a single POM file for each project.

A - true

B - false

Answer : A

Explanation

There should be a single POM file for each project.

Answer : C

Explanation

This is the version of the project.Along with the groupId, It is used within an artifact's repository to separate versions from each other. For example: com.company.bank:consumer-banking:1.0, com.company.bank:consumer-banking:1.1.

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

Explanation

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

maven_questions_answers.htm

Useful Video Courses


Video

Learn Maven and Ant the easy way!

34 Lectures 4 hours

Karthikeya T

Video

Learn Maven

14 Lectures 1.5 hours

Quaatso Learning

Advertisements