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

Maven is a project management and comprehension tool. Maven provides developers a complete build lifecycle framework.

Q 2 - Which of the following configuration element is present in POM.xml?

A - developers

B - mailing list

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 phase in maven life cycle installs the package into the local repository, for use as a dependency in other projects locally?

A - integration-test

B - verify

C - install

D - deploy

Answer : C

Explanation

install phase installs the package into the local repository, for use as a dependency in other projects locally.

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 command can be used to create a new project based on an archtype?

A - mvn archetype:archetype

B - mvn archetype:generate

C - mvn generate:archetype

D - None of the above.

Answer : B

Explanation

mvn archetype:generate command can be used to create a new project based on an archtype.

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.

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