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? Answer: d 2. Which of the following is not a maven goal? Answer: d 3. Which file is used to define dependency in maven? Answer: b 4. Which file is used to specify the packaging cycle? Answer: a 5. Which environment variable is used to specify the path to maven? Answer: c 6. Which of the below is a source code management tool? Answer: c 7. Can we run Junits as a part of Jenkins job? Answer: a 8. Which command can be used to check maven version? Answer: d 9. Which of the following is not true for Ant? Answer: b 10. Which maven plugin creates the project structure? Answer: c
a) Ant
b) Maven
c) Gradle
d) Jenkins
Clarification: Jenkins is continuous integration system. Ant, Maven, Gradle is used for build process.
a) clean
b) package
c) install
d) debug
Clarification: clean, package, install are maven goals. Debug is used finding and resolving of defects.
a) build.xml
b) pom.xml
c) dependency.xml
d) version.xml
Clarification: pom.xml is used to define dependency which is used to package the jar. POM stands for project object model.
a) build.xml
b) pom.xml
c) dependency.xml
d) version.xml
Clarification: Project structure is specified in build.xml.
a) JAVA_HOME
b) PATH
c) MAVEN_HOME
d) CLASSPATH
Clarification: MAVEN_HOME should be set to the bin folder of maven installation.
a) Jenkins
b) Maven
c) Git
d) Hudson
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.
a) True
b) False
Clarification: As a part of jenkins job, we can run junits, fitnesse, test coverage reports, call shell or bat scripts, etc.
a) mvn -ver
b) maven -ver
c) maven -version
d) mvn -version
Clarification: mvn -version can be used to check the version of installed maven from command prompt.
a) It is a tool box
b) It provides lifecycle management
c) It is procedural
d) It doesn’t have formal conventions
Clarification: Ant doesn’t provide lifecycle management. Maven provides lifecycle.
a) dependency
b) properties
c) archetype
d) execution
Clarification: Archetype is the maven plugin which creates the project structure.