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

Maven is a project management and comprehension tool. Maven provides developers a complete build lifecycle framework.

Answer : B

Explanation

default (or build) − This is used to build the application.

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 'clean' Maven life cycle?

A - pre-clean

B - clean

C - post-clean

D - All of the above.

Answer : D

Explanation

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

Answer : C

Explanation

SNAPSHOT is a special version that indicates a current development copy. Unlike regular versions, Maven checks for a new SNAPSHOT version in a remote repository for every build.

Q 6 - Which of the following scope indicates that the dependency is only available for the test compilation and execution phases?

A - compile

B - provided

C - runtime

D - test

Answer : D

Explanation

test − This scope indicates that the dependency is only available for the test compilation and execution phases.

Answer : D

Explanation

A mojo is a Maven plain Old Java Object. Each mojo is an executable goal in Maven, and a plugin is a distribution of one or more related mojos.

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 post-processes the generated files from compilation, for example to do bytecode enhancement/optimization on Java classes?

A - process-classes

B - process-test-sources

C - process-test-classes

D - None of the above.

Answer : A

Explanation

process-classes post-processes the generated files from compilation, for example to do bytecode enhancement/optimization on Java classes.

Q 10 - When Maven starts looking for dependency libraries, it first searches dependency in local repository.

A - true

B - false

Answer : A

Explanation

When Maven starts looking for dependency libraries, it first searches dependency in local repository.

maven_questions_answers.htm
Advertisements