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 : D

Explanation

Each artifact has a group ID (usually a reversed domain name, like com.example.foo), an artifact ID (just a name), and a version string. The three together uniquely identify the artifact. A project's dependencies are specified as artifacts.

Q 3 - Which of the following command quickly builds Maven site?

A - mvn clean

B - mvn build

C - mvn compile

D - mvn site

Answer : D

Explanation

mvn site command can quickly builds Maven site.

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.

Q 5 - Which of the following scope indicates that dependency is available in classpath of project?

A - compile

B - provided

C - runtime

D - test

Answer : A

Explanation

compile − This scope indicates that dependency is available in classpath of project. It is default scope.

Q 6 - Which of the following scope indicates that dependency is not required for compilation, but is required during execution?

A - compile

B - provided

C - runtime

D - test

Answer : C

Explanation

runtime − This scope indicates that dependency is not required for compilation, but is required during execution.

Q 7 - What is the value for packaging element in pom for a project that is purely meta-data?

A - ear

B - war

C - jar

D - pom

Answer : D

Explanation

pom is the value for packaging element in pom for a project that is purely meta-data.

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 resources to be included in the package?

A - generate-resources

B - generate-sources

C - generate-test-sources

D - None of the above.

Answer : A

Explanation

generate-resources generates resources to be included in the package.

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