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

Explanation

POM stands for Project Object Model.

Q 2 - Which of the following configuration element is present in POM.xml?

A - build profiles

B - project version

C - Both of the above.

D - None of the above.

Answer : C

Explanation

Both of the above configuration elements are present in POM.xml.

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.

Answer : C

Explanation

A repository is a place i.e. directory where all the project jars, library jar, plugins or any other project specific artifacts are stored and can be used by Maven easily.

Answer : D

Explanation

It is repository provided by Maven community. It contains a large number of commonly used libraries. When Maven does not find any dependency in local repository, it starts searching in central repository using following URL: http://repo1.maven.org/maven2/.

Q 6 - Which of the following scope indicates that you have to provide the system path?

A - system

B - import

C - runtime

D - test

Answer : A

Explanation

system − This scope indicates that you have to provide the system path.

Answer : B

Explanation

A mojo is a Maven plain Old Java Object.

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 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.

Q 10 - Which of the following plugin run the JUnit unit tests and creates test reports?

A - surefile

B - jar

C - war

D - antrun

Answer : A

Explanation

surefire plugin run the JUnit unit tests and creates test reports.

maven_questions_answers.htm
Advertisements