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

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.

Q 2 - Which of the following command removes the target directory with all the build data before starting the build process?

A - mvn clean

B - mvn build

C - mvn compile

D - mvn site

Answer : A

Explanation

mvn clean command removes the target directory with all the build data before starting the build process.

Q 3 - Which of the following command quickly builds Maven site?

A - mvn clean

B - mvn build

C - mvn compile

D - mvn site

Answer : D

Explanation

mvn site command can quickly builds Maven site.

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.

Answer : A

Explanation

It is developer's own custom repository containing required libraries or other project jars.

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.

Answer : C

Explanation

Maven provides a comprehensive model for projects which is reusable, maintainable, and easier to comprehend and provides plugins or tools that interact with its declarative model.

Q 8 - Which of the following is correct about artifactId in Maven pom.xml?

A - This is an Id of the project.

B - This is generally name of the project.

C - Both of the above.

D - None of the above.

Answer : C

Explanation

This is an Id of the project.This is generally name of the project. For example, consumer-banking. Along with the groupId, the artifactId defines the artifact's location within the repository.

Q 9 - Which of the following phase in maven life cycle generates resources to be included in the package?

A - generate-resources

B - generate-sources

C - generate-test-sources

D - None of the above.

Answer : A

Explanation

generate-resources generates resources to be included in the package.

Answer : D

Explanation

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

maven_questions_answers.htm
Advertisements