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

POM contains information about the project and various configuration details used by Maven to build the project(s) and it always resides in the base directory of the project as pom.xml.

Answer : D

Explanation

Each artifact has a group ID (usually a reversed domain name, like com.example.foo), an artifact ID (just a name), and a version string. The three together uniquely identify the artifact. A project's dependencies are specified as artifacts.

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.

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.

Q 5 - Which of the following maven plugin executes during the site generation and they should be configured in the element of the pom.xml?

A - Build plugins

B - Reporting plugins

C - Both of the above

D - None of the above.

Answer : B

Explanation

Reporting plugins − They execute during the site generation and they should be configured in the element of the pom.xml.

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.

Q 8 - Which of the following command can be used to look at the default configurations of the super POM?

A - mvn help:effective-pom

B - mvn help

C - mvn help:super-pom

D - None of the above.

Answer : A

Explanation

mvn help − effective-pom command can be used to look at the default configurations of the super POM.

Q 9 - Which of the following phase in maven life cycle copies and processes the resources into the destination directory, ready for packaging phase?

A - process-sources

B - process-resources

C - process-test-sources

D - None of the above.

Answer : B

Explanation

process-resources copies and processes the resources into the destination directory, ready for packaging phase.

Answer : D

Explanation

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


maven_questions_answers.htm

Advertisements