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

Explanation

Development team can automate the project's build infrastructure in almost no time as Maven uses a standard directory layout and a default build lifecycle.

Answer : A

Explanation

clean: cleans up artifacts created by prior builds.

Q 3 - Which of the following phase in maven life cycle compiles the source code of the project?

A - validate

B - compile

C - test

D - package

Answer : B

Explanation

compile phase compile the source code of the project.

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 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 scope is the default scope?

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 7 - All POM files require the project element and three mandatory fields: groupId, artifactId,version.

A - false

B - true

Answer : B

Explanation

All POM files require the project element and three mandatory fields: groupId, artifactId,version.

Q 8 - Root element of POM.xml is project.

A - true

B - false

Answer : A

Explanation

Root element of POM.xml is project.

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