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?
a) Ant
b) Maven
c) Gradle
d) Jenkins
View Answer
Explanation: 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
View Answer
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?
a) build.xml
b) pom.xml
c) dependency.xml
d) version.xml
View Answer
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?
a) build.xml
b) pom.xml
c) dependency.xml
d) version.xml
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
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?
a) True
b) False
View Answer
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
View Answer
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
View Answer
Explanation: 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
View Answer
Explanation: Archetype is the maven plugin which creates the project structure.
Sanfoundry Global Education & Learning Series – Java Programming Language.
To practice all areas of Java language, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Check Java Books
- Practice Programming MCQs
- Apply for Computer Science Internship
- Practice BCA MCQs
- Check Programming Books