Advanced 250+ TOP MCQs on Application Lifecycle – Ant, Maven and Jenkins and Answers

This set of Advanced Java Multiple Choice Questions & Answers (MCQs) on “Application Lifecycle – Ant, Maven and Jenkins”.

1. Which of below is not a dependency management tool?
a) Ant
b) Maven
c) Gradle
d) Jenkins

Answer: d
Clarification: Jenkins is continuous integration system. Ant, Maven, Gradle is used for build process.

2. Which of the following is not a maven goal?
a) clean
b) package
c) install
d) debug

Answer: d
Clarification: clean, package, install are maven goals. Debug is used finding and resolving of defects.

3. Which file is used to define dependency in maven?
a) build.xml
b) pom.xml
c) dependency.xml
d) version.xml

Answer: b
Clarification: pom.xml is used to define dependency which is used to package the jar. POM stands for project object model.

4. Which file is used to specify the packaging cycle?
a) build.xml
b) pom.xml
c) dependency.xml
d) version.xml

Answer: a
Clarification: Project structure is specified in build.xml.

5. Which environment variable is used to specify the path to maven?
a) JAVA_HOME
b) PATH
c) MAVEN_HOME
d) CLASSPATH

Answer: c
Clarification: MAVEN_HOME should be set to the bin folder of maven installation.

6. Which of the below is a source code management tool?
a) Jenkins
b) Maven
c) Git
d) Hudson

Answer: c
Clarification: Source code management tools help is version control, compare different versions of code, crash management, etc. Git, SVN are popular source code management tools.

7. Can we run Junits as a part of Jenkins job?
a) True
b) False

Answer: a
Clarification: As a part of jenkins job, we can run junits, fitnesse, test coverage reports, call shell or bat scripts, etc.

8. Which command can be used to check maven version?
a) mvn -ver
b) maven -ver
c) maven -version
d) mvn -version

Answer: d
Clarification: mvn -version can be used to check the version of installed maven from command prompt.

9. Which of the following is not true for Ant?
a) It is a tool box
b) It provides lifecycle management
c) It is procedural
d) It doesn’t have formal conventions

Answer: b
Clarification: Ant doesn’t provide lifecycle management. Maven provides lifecycle.

10. Which maven plugin creates the project structure?
a) dependency
b) properties
c) archetype
d) execution

Answer: c
Clarification: Archetype is the maven plugin which creates the project structure.

Leave a Reply

Your email address will not be published. Required fields are marked *