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

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.

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 validates that the project is correct and all necessary information is available?

A - validate

B - compile

C - test

D - package

Answer : A

Explanation

validate phase validates that the project is correct and all necessary information is available.

Q 4 - Which of the following phases is present in 'site' Maven life cycle?

A - pre-site

B - site

C - site-deploy

D - All of the above.

Answer : D

Explanation

The site lifecycle consists of the following phases: 1) pre-site 2) site 3) post-site and 4) site-deploy.

Answer : D

Explanation

It is repository provided by Maven community. It contains a large number of commonly used libraries. When Maven does not find any dependency in local repository, it starts searching in central repository using following URL: http://repo1.maven.org/maven2/.

Q 6 - Which of the following is the default value of packaging?

A - ear

B - war

C - jar

D - pom

Answer : C

Explanation

If no packaging value has been specified, it will default to jar.

Answer : A

Explanation

The <execution> element contains information's required for the execution of a plugin.

Answer : D

Explanation

A goal represents a specific task which contributes to the building and managing of a project. It may be bound to zero or more build phases. A goal not bound to any build phase could be executed outside of the build lifecycle by direct invocation.

Q 9 - Which of the following phase in maven life cycle performs actions required before integration tests are executed. For example, setting up the required environment?

A - process-resources

B - pre-integration-test

C - prepare-package

D - None of the above.

Answer : B

Explanation

pre-integration-test performs actions required before integration tests are executed. For example, setting up the required environment.

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

A - true

B - false

Answer : A

Explanation

Maven searches dependency in remote repository or repositories, if found then it is downloaded to local repository for future reference otherwise Maven as expected stop processing and throws error (Unable to find dependency).


maven_questions_answers.htm

Advertisements