This set of Advanced Java Multiple Choice Questions & Answers (MCQs) focuses on “Application Lifecycle – Ant, Maven and Jenkins”.
1. Which of below is not a dependency management tool?
Explanation: Jenkins is continuous integration system. Ant, Maven, Gradle is used for build process.
2. Which of the following is not a maven goal?
Explanation: clean, package, install are maven goals. Debug is used finding and resolving of defects.
3. Which file is used to define dependency in maven?
Explanation: 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?
Explanation: Project structure is specified in build.xml.
5. Which environment variable is used to specify the path to maven?
Explanation: MAVEN_HOME should be set to the bin folder of maven installation.
6. Which of the below is a source code management tool?
Explanation: 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?
Explanation: 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
Explanation: 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
Explanation: Ant doesn’t provide lifecycle management. Maven provides lifecycle.
10. Which maven plugin creates the project structure?
Explanation: Archetype is the maven plugin which creates the project structure.
Sanfoundry Global Education & Learning Series – Java Programming Language.