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

Maven uses Convention over Configuration which means developers are not required to create build process themselves. Developers do not have to mention each and every configuration details.

Answer : A

Explanation

clean: cleans up artifacts created by prior builds.

Q 3 - 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 - integration-test

B - verify

C - install

D - deploy

Answer : A

Explanation

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

Q 4 - Using which of the following way, you can activate a Maven Build Profile?

A - OS Settings (for example, Windows family).

B - Present/missing files.

C - Both of the above.

D - None of the above.

Answer : C

Explanation

Using both of the above ways, you can activate a Maven Build Profile.

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

A - Build plugins

B - Reporting plugins

C - Both of the above

D - None of the above.

Answer : A

Explanation

Build plugins − They execute during the build and should be configured in the element of pom.xml.

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.

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

Answer : C

Explanation

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

maven_questions_answers.htm
Advertisements