Advanced Java Questions & Answers – Application Lifecycle – Ant, Maven and Jenkins

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

Answer: d
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

Answer: d
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

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

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

Answer: a
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

Answer: c
Explanation: MAVEN_HOME should be set to the bin folder of maven installation.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

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

Answer: c
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

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

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

Answer: d
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

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

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

Answer: c
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.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.