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

B - mailing list

C - Both of the above.

D - None of the above.

Answer : C

Explanation

Both of the above aspects of a project can be managed using Maven.

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 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 Build Profile is defined in Maven global settings xml file (%M2_HOME%/conf/settings.xml)?

A - Per Project

B - Per User

C - Global

D - None of the above.

Answer : C

Explanation

Global − Defined in Maven global settings xml file (%M2_HOME%/conf/settings.xml).

Q 5 - Which of the following scope indicates that dependency is available in classpath of project?

A - compile

B - provided

C - runtime

D - test

Answer : A

Explanation

compile − This scope indicates that dependency is available in classpath of project. It is default scope.

Q 6 - Which of the following scope indicates that dependency is to be provided by JDK or web-Server/Container at runtime?

A - compile

B - provided

C - runtime

D - test

Answer : B

Explanation

provided − This scope indicates that dependency is to be provided by JDK or web-Server/Container at runtime.

Answer : B

Explanation

A mojo is a Maven plain Old Java Object.

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 generates any test source code to be included in compilation phase?

A - process-classes

B - process-test-sources

C - generate-test-sources

D - None of the above.

Answer : C

Explanation

generate-test-sources generates any test source code to be included in compilation phase.

Q 10 - Which of the following phase in maven life cycle processes and deploys the package if necessary into an environment where integration tests can be run?

A - process-resources

B - pre-integration-test

C - integration-test

D - None of the above.

Answer : C

Explanation

integration-test processes and deploys the package if necessary into an environment where integration tests can be run.

maven_questions_answers.htm
Advertisements