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.

Answer : C

Explanation

site − generates site documentation for the project.

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.

Answer : D

Explanation

Maven local repository is a folder location on your machine. It gets created when you run any maven command for the first time. Maven local repository keeps your project's all dependencies (library jars, plugin jars etc).

Q 6 - Which of the following scope indicates that you have to provide the system path?

A - system

B - import

C - runtime

D - test

Answer : A

Explanation

system − This scope indicates that you have to provide the system path.

Answer : C

Explanation

When a Maven project is created, Maven creates default project structure. Developer is only required to place files accordingly and he/she need not to define any configuration in pom.xml.

Q 8 - Which of the following command can be used to look at the default configurations of the super POM?

A - mvn help:effective-pom

B - mvn help

C - mvn help:super-pom

D - None of the above.

Answer : A

Explanation

mvn help − effective-pom command can be used to look at the default configurations of the super POM.

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