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

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

A - project dependencies

B - plugins

C - goals

D - All of the above.

Answer : D

Explanation

All of the above configuration elements are present in POM.xml.

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 - 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 refers to the version of the project?

A - ${pom.version}

B - ${project.version}

C - ${maven.version}

D - ${version}

Answer : A

Explanation

${pom.version} refers to the version of the project.

Q 7 - There should be a single POM file for each project.

A - true

B - false

Answer : A

Explanation

There should be a single POM file for each project.

Answer : C

Explanation

Maven use the effective pom (configuration from super pom plus project configuration) to execute relevant goal. It helps developer to specify minimum configuration detail in his/her pom.xml. Although configurations can be overridden easily.

Q 9 - Which of the following phase in maven life cycle copies and processes the resources into the destination directory, ready for packaging phase?

A - process-sources

B - process-resources

C - process-test-sources

D - None of the above.

Answer : B

Explanation

process-resources copies and processes the resources into the destination directory, ready for packaging phase.

Q 10 - When dependency in local repository is not found, then Maven searches dependency in central repository.

A - true

B - false

Answer : A

Explanation

Maven searches dependency in central repository, if not found and remote repository/repositories is/are mentioned then searches in remote repositories else if found, then it is downloaded to local repository for future reference.

maven_questions_answers.htm
Advertisements