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.

Answer : C

Explanation

A maven artifact is a file, usually a JAR that gets deployed to a Maven repository. A Maven build produces one or more artifacts, such as a compiled JAR and a 'sources' JAR.

Q 3 - Which of the following phase in maven life cycle is done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects?

A - integration-test

B - verify

C - install

D - deploy

Answer : D

Explanation

deploy phase is done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.

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.

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 refers to the final name of the file created when the built project is packaged?

A - ${pom.build.finalName}

B - ${project.build.finalName}

C - ${maven.build.finalName}

D - ${build.finalName}

Answer : A

Explanation

${pom.build.finalName} refers to the final name of the file created when the built project is packaged.

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 - Which of the following phase in maven life cycle generates any source code to be included in compilation phase?

A - generate-sources

B - generate-resources

C - generate-test-sources

D - None of the above.

Answer : A

Explanation

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

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