SlideShare une entreprise Scribd logo
1  sur  59
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
www.edureka.co
INTERVIEW QUESTIONS FOR BEGINNERS
INTERVIEW QUESTIONS FOR THE INTERMEDIATE
www.edureka.co
INTERVIEW QUESTIONS FOR THE EXPERIENCED
www.edureka.co
What is a Maven?01.
Apache Maven is a software project management and comprehension tool. Based on the
concept of a project object model (POM), Maven can manage a project's build, reporting
and documentation from a central piece of information.
www.edureka.co
What are the main features of Maven?02.
• Simple and Fast
• Easy to learn
• Dependency management
• Multiple projects
• Large library
• Extensible
• Instant
www.edureka.co
What are the functions of a build tool?03.
• Generate
• Documentation
• Compile
• Package
• Install
www.edureka.co
Why should one use Maven?04.
It helps to setup project very quickly and it avoids complicated build files like build.xml.
www.edureka.co
List the differences between ANT and Maven.05.
www.edureka.co
Mention the steps for installing Maven.06.
• Maven can be downloaded and installed on windows, linux, and MAC OS platforms.
www.edureka.co
What does it mean when you say Maven uses
Convention over Configuration?
07.
• In case of Configuration, developers need to create the build processes manually and
has to specify each and every configuration in detail.
• Once a developer creates a project in Maven, it will automatically create a structure.
www.edureka.co
What are the aspects that Maven manages?08.
• Builds
• Documentation
• Reporting
• Dependencies
• SCMs
• Releases
• Distribution
• Mailing list
www.edureka.co
What is POM?9.
• POM stands for Project Object Model. It is fundamental Unit of Work in Maven.
www.edureka.co
What information does POM contain?10.
• project dependencies
• plugins
• goals
• build profiles
• project version
• developers
• mailing list
www.edureka.co
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
www.edureka.co
What is Maven artifact?11.
An artifact is a file, usually a JAR that gets deployed to a Maven repository. A Maven build
produces one or more artifacts, such as a compiled JAR and a "sources" JAR.
www.edureka.co
What is Maven Build Lifecycle?12.
A Build Lifecycle is a well-defined sequence of phases. It defines the order in which the
goals are to be executed. Each build phase consists of a sequence of goals.
www.edureka.co
Name the 3 build lifecycles of Maven.13.
• clean:cleans up artifacts created by prior builds.
• default (or build):This is used to build the application.
• site: generates site documentation for the project.
www.edureka.co
What is the command to quickly build your Maven
site?
14.
Type the command − mvn site
www.edureka.co
What would the command mvn clean do ?15.
This command removes the target directory with all the build data before starting the
build process.
www.edureka.co
What are the phases of a Maven Build Lifecycle?16.
• Validate
• Compile
• Test
• Package
• Integration test
• Verify
• Install
• deploy
www.edureka.co
What is a goal in Maven terminology?17.
A goal represents a specific task which contributes to the building and managing of a
project. It may be bound to zero or more build phases.
www.edureka.co
What would this command do mvn clean
dependency:copy-dependencies package?
18.
This command will clean the project, copy the dependencies and package the project
(executing all phases up to package).
www.edureka.co
What phases does a Clean Lifecycle consist?19.
The clean lifecycle consists of the following phases −
• pre-clean
• clean
• post-clean
www.edureka.co
What phases does a Site Lifecycle consist?20.
The phases in Site Lifecycle are −
• pre-site
• site
• post-site
• site-deploy
www.edureka.co
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
www.edureka.co
www.edureka.co
What is a Maven Repository?21.
A repository is a place i.e. directory where all the project jars, library jar, plugins
www.edureka.co
What are the types of Maven repositories?22.
Maven repository are of three types: local, central, remote
www.edureka.co
What is the default location for your local
repository?
23.
~/m2./repository
www.edureka.co
What is Build Profile?24.
A Build profile is a set of configuration values which can be used to set or override
default values of Maven build
www.edureka.co
What are different types of Build Profiles?25.
• Per Project
• Per User
• Global
www.edureka.co
How can you activate profiles?26.
A Maven Build Profile can be activated in five ways
www.edureka.co
What is the sequence in which Maven searches for
dependency libraries?
27.
There are 4 steps in which Maven searches for dependenies
www.edureka.co
When does Maven use External Dependency
concept?
28.
Maven dependency management uses concept of Maven Repositories (Local, Central,
Remote).
www.edureka.co
What are the things you need to define for each
external dependency?
29.
External dependencies (library jar location) can be configured in pom.xml in same way as
other dependencies.
www.edureka.co
What are the types of Maven Plugins?30.
Maven provides following two types of Plugins − Build plugins and Reporting plugins
www.edureka.co
Why are Maven Plugins used?31.
Maven Plugins are used to −
• create jar file.
• create war file.
• compile code files.
• unit testing of code.
• create project documentation.
• create project reports.
www.edureka.co
What is Archetype?32.
Archetype is a Maven plugin whose task is to create a project structure as per its
template.
www.edureka.co
What is the command to create a new project
based on an archtype?
33.
mvn archetype:generate
www.edureka.co
What is SNAPSHOT in Maven?34.
SNAPSHOT is a special version that indicates a current development copy.
www.edureka.co
What is difference between Snapshot and Version?35.
In case of Version, if Maven once downloaded the mentioned version say
data-service:1.0, it will never try to download a newer 1.0 available in
repository.
www.edureka.co
What is transitive dependency in Maven?36.
Transitive dependency means to avoid needing to discover and specify the libraries that
your own dependencies require, and including them automatically.
www.edureka.co
What does dependency management mean in the
context of transitive dependency?
37.
It means to directly specify the versions of artifacts to be used when they are
encountered in transitive dependencies.
www.edureka.co
Does Maven determine what version of dependency will be used
when multiple version of an artifact are encountered? If yes, How?
38.
Maven determines what version of a dependency is to be used when multiple versions of
an artifact are encountered.
www.edureka.co
What is dependency scope? Name all the
dependency scope
39.
Dependency scope includes dependencies as per the current stage of the build.
Various dependency scopes are – compile, provided, runtime, test, system and
import.
www.edureka.co
www.edureka.co
What is the minimal set of information for matching a dependency references
against a dependencyManagement section ?
40.
{groupId,artifactId,type,classifier}.
www.edureka.co
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
www.edureka.co
How do you reference a property defined in your
pom.xml file?
41.
To reference a property defined in your pom.xml, the property name uses the names of
the XML elements
www.edureka.co
What are the default values for packaging element? If there is no
packaging element defined,What is the default value for that?
42.
Some of the valid packaging values are jar, war, ear and pom.
www.edureka.co
What is the use of execution element in pom file?43.
The <execution> element contains information's required for the execution of a plugin.
www.edureka.co
What is a project's fully qualified artifact name?44.
<groupId>:<artifactId>:<version>
www.edureka.co
What are the benefit of storing JARS/external
dependencies in local repository instead of remote
one?
45.
It uses less storage, it makes checking out project quicker, non need for versioning JAR
files.
www.edureka.co
How can you build your project offline?46.
Use the command − mvn o package.
www.edureka.co
What is a system dependency?47.
Dependency with scope system are always available and are not looked up in repository,
they are usually used to tell Maven about dependencies which are provided by the JDK or
the VM.
www.edureka.co
What is the use of optional dependency?48.
Any transitive dependency can be marked as optional using "optional" element.
www.edureka.co
What is a Mojo?49.
A mojo is a Maven plain Old Java Object. Each mojo is an executable goal in Maven, and a
plugin is a distribution of one or more related mojos.
www.edureka.co
What are steps involved in project deployment?50.
There are 6 steps involved in project deployment
www.edureka.co
www.edureka.co

Contenu connexe

Tendances

Indic threads java10-spring-roo-and-the-cloud
Indic threads java10-spring-roo-and-the-cloudIndic threads java10-spring-roo-and-the-cloud
Indic threads java10-spring-roo-and-the-cloud
Shekhar Gulati
 

Tendances (20)

Spring Book – Chapter 1 – Introduction
Spring Book – Chapter 1 – IntroductionSpring Book – Chapter 1 – Introduction
Spring Book – Chapter 1 – Introduction
 
Make Spring Home (Spring Customization and Extensibility)
Make Spring Home (Spring Customization and Extensibility)Make Spring Home (Spring Customization and Extensibility)
Make Spring Home (Spring Customization and Extensibility)
 
Microservices Design Patterns | Edureka
Microservices Design Patterns | EdurekaMicroservices Design Patterns | Edureka
Microservices Design Patterns | Edureka
 
AliExpress’ Way to Microservices - microXchg 2017
AliExpress’ Way to Microservices  - microXchg 2017AliExpress’ Way to Microservices  - microXchg 2017
AliExpress’ Way to Microservices - microXchg 2017
 
Webinar: DevOps - Redefining your IT Strategy
Webinar: DevOps - Redefining your IT StrategyWebinar: DevOps - Redefining your IT Strategy
Webinar: DevOps - Redefining your IT Strategy
 
React a11y-csun
React a11y-csunReact a11y-csun
React a11y-csun
 
How To Learn Programming For Beginners | How To Start Coding | Learn Programm...
How To Learn Programming For Beginners | How To Start Coding | Learn Programm...How To Learn Programming For Beginners | How To Start Coding | Learn Programm...
How To Learn Programming For Beginners | How To Start Coding | Learn Programm...
 
List of 7 popular java frameworks for 2019
List of 7 popular java frameworks for 2019  List of 7 popular java frameworks for 2019
List of 7 popular java frameworks for 2019
 
CV_Sydul_Fahim_Pantha
CV_Sydul_Fahim_PanthaCV_Sydul_Fahim_Pantha
CV_Sydul_Fahim_Pantha
 
Shift left-csun-sagar-barbhaya
Shift left-csun-sagar-barbhayaShift left-csun-sagar-barbhaya
Shift left-csun-sagar-barbhaya
 
Indic threads java10-spring-roo-and-the-cloud
Indic threads java10-spring-roo-and-the-cloudIndic threads java10-spring-roo-and-the-cloud
Indic threads java10-spring-roo-and-the-cloud
 
Java Web Application Security - Utah JUG 2011
Java Web Application Security - Utah JUG 2011Java Web Application Security - Utah JUG 2011
Java Web Application Security - Utah JUG 2011
 
Spring Boot & Actuators
Spring Boot & ActuatorsSpring Boot & Actuators
Spring Boot & Actuators
 
Java for beginners
Java for beginnersJava for beginners
Java for beginners
 
Spring boot vs spring framework razor sharp web applications
Spring boot vs spring framework razor sharp web applicationsSpring boot vs spring framework razor sharp web applications
Spring boot vs spring framework razor sharp web applications
 
Top 10 Frameworks Programmers Should Learn in 2020
Top 10 Frameworks Programmers Should Learn in 2020Top 10 Frameworks Programmers Should Learn in 2020
Top 10 Frameworks Programmers Should Learn in 2020
 
Not Just Initializing
Not Just InitializingNot Just Initializing
Not Just Initializing
 
RishabhaSInghCVnew
RishabhaSInghCVnewRishabhaSInghCVnew
RishabhaSInghCVnew
 
Building Faster With Your Team's UI Kit
Building Faster With Your Team's UI KitBuilding Faster With Your Team's UI Kit
Building Faster With Your Team's UI Kit
 
Top Reasons Why Java Rocks (report preview) - http:0t.ee/java-rocks
Top Reasons Why Java Rocks (report preview) - http:0t.ee/java-rocksTop Reasons Why Java Rocks (report preview) - http:0t.ee/java-rocks
Top Reasons Why Java Rocks (report preview) - http:0t.ee/java-rocks
 

Similaire à Top Maven Interview Questions in 2020 | Edureka

WebObjects Developer Tools
WebObjects Developer ToolsWebObjects Developer Tools
WebObjects Developer Tools
WO Community
 
Package Repositories: The Unsung Heroes of Configuration and Release Managem...
Package Repositories:  The Unsung Heroes of Configuration and Release Managem...Package Repositories:  The Unsung Heroes of Configuration and Release Managem...
Package Repositories: The Unsung Heroes of Configuration and Release Managem...
IBM UrbanCode Products
 
Spring intro classes-in-mumbai
Spring intro classes-in-mumbaiSpring intro classes-in-mumbai
Spring intro classes-in-mumbai
vibrantuser
 

Similaire à Top Maven Interview Questions in 2020 | Edureka (20)

What is maven
What is mavenWhat is maven
What is maven
 
Lorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - MavenLorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - Maven
 
S/W Design and Modularity using Maven
S/W Design and Modularity using MavenS/W Design and Modularity using Maven
S/W Design and Modularity using Maven
 
Maven in mulesoft
Maven in mulesoftMaven in mulesoft
Maven in mulesoft
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
Mavennotes.pdf
Mavennotes.pdfMavennotes.pdf
Mavennotes.pdf
 
Apache Maven - eXo TN presentation
Apache Maven - eXo TN presentationApache Maven - eXo TN presentation
Apache Maven - eXo TN presentation
 
Introduction to maven
Introduction to mavenIntroduction to maven
Introduction to maven
 
(Re)-Introduction to Maven
(Re)-Introduction to Maven(Re)-Introduction to Maven
(Re)-Introduction to Maven
 
Build tool
Build toolBuild tool
Build tool
 
software technology benchmarking
software  technology benchmarkingsoftware  technology benchmarking
software technology benchmarking
 
WebObjects Developer Tools
WebObjects Developer ToolsWebObjects Developer Tools
WebObjects Developer Tools
 
Maven
MavenMaven
Maven
 
Apache maven and its impact on java 9 (Java One 2017)
Apache maven and its impact on java 9 (Java One 2017)Apache maven and its impact on java 9 (Java One 2017)
Apache maven and its impact on java 9 (Java One 2017)
 
Spring introduction
Spring introductionSpring introduction
Spring introduction
 
Os php-wiki1-pdf
Os php-wiki1-pdfOs php-wiki1-pdf
Os php-wiki1-pdf
 
Session 2
Session 2Session 2
Session 2
 
Session 2
Session 2Session 2
Session 2
 
Package Repositories: The Unsung Heroes of Configuration and Release Managem...
Package Repositories:  The Unsung Heroes of Configuration and Release Managem...Package Repositories:  The Unsung Heroes of Configuration and Release Managem...
Package Repositories: The Unsung Heroes of Configuration and Release Managem...
 
Spring intro classes-in-mumbai
Spring intro classes-in-mumbaiSpring intro classes-in-mumbai
Spring intro classes-in-mumbai
 

Plus de Edureka!

Plus de Edureka! (20)

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | Edureka
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | Edureka
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | Edureka
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | Edureka
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
 
ITIL® Tutorial for Beginners | ITIL® Foundation Training | Edureka
ITIL® Tutorial for Beginners | ITIL® Foundation Training | EdurekaITIL® Tutorial for Beginners | ITIL® Foundation Training | Edureka
ITIL® Tutorial for Beginners | ITIL® Foundation Training | Edureka
 
Difference between ITIL v3 and ITIL 4 | ITIL® Foundation Training | Edureka
Difference between ITIL v3 and ITIL 4 | ITIL® Foundation Training | EdurekaDifference between ITIL v3 and ITIL 4 | ITIL® Foundation Training | Edureka
Difference between ITIL v3 and ITIL 4 | ITIL® Foundation Training | Edureka
 

Dernier

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 

Top Maven Interview Questions in 2020 | Edureka

  • 1. Copyright © 2017, edureka and/or its affiliates. All rights reserved. www.edureka.co
  • 2. INTERVIEW QUESTIONS FOR BEGINNERS INTERVIEW QUESTIONS FOR THE INTERMEDIATE www.edureka.co INTERVIEW QUESTIONS FOR THE EXPERIENCED
  • 4. What is a Maven?01. Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information. www.edureka.co
  • 5. What are the main features of Maven?02. • Simple and Fast • Easy to learn • Dependency management • Multiple projects • Large library • Extensible • Instant www.edureka.co
  • 6. What are the functions of a build tool?03. • Generate • Documentation • Compile • Package • Install www.edureka.co
  • 7. Why should one use Maven?04. It helps to setup project very quickly and it avoids complicated build files like build.xml. www.edureka.co
  • 8. List the differences between ANT and Maven.05. www.edureka.co
  • 9. Mention the steps for installing Maven.06. • Maven can be downloaded and installed on windows, linux, and MAC OS platforms. www.edureka.co
  • 10. What does it mean when you say Maven uses Convention over Configuration? 07. • In case of Configuration, developers need to create the build processes manually and has to specify each and every configuration in detail. • Once a developer creates a project in Maven, it will automatically create a structure. www.edureka.co
  • 11. What are the aspects that Maven manages?08. • Builds • Documentation • Reporting • Dependencies • SCMs • Releases • Distribution • Mailing list www.edureka.co
  • 12. What is POM?9. • POM stands for Project Object Model. It is fundamental Unit of Work in Maven. www.edureka.co
  • 13. What information does POM contain?10. • project dependencies • plugins • goals • build profiles • project version • developers • mailing list www.edureka.co
  • 14. Copyright © 2017, edureka and/or its affiliates. All rights reserved. www.edureka.co
  • 15. What is Maven artifact?11. An artifact is a file, usually a JAR that gets deployed to a Maven repository. A Maven build produces one or more artifacts, such as a compiled JAR and a "sources" JAR. www.edureka.co
  • 16. What is Maven Build Lifecycle?12. A Build Lifecycle is a well-defined sequence of phases. It defines the order in which the goals are to be executed. Each build phase consists of a sequence of goals. www.edureka.co
  • 17. Name the 3 build lifecycles of Maven.13. • clean:cleans up artifacts created by prior builds. • default (or build):This is used to build the application. • site: generates site documentation for the project. www.edureka.co
  • 18. What is the command to quickly build your Maven site? 14. Type the command − mvn site www.edureka.co
  • 19. What would the command mvn clean do ?15. This command removes the target directory with all the build data before starting the build process. www.edureka.co
  • 20. What are the phases of a Maven Build Lifecycle?16. • Validate • Compile • Test • Package • Integration test • Verify • Install • deploy www.edureka.co
  • 21. What is a goal in Maven terminology?17. A goal represents a specific task which contributes to the building and managing of a project. It may be bound to zero or more build phases. www.edureka.co
  • 22. What would this command do mvn clean dependency:copy-dependencies package? 18. This command will clean the project, copy the dependencies and package the project (executing all phases up to package). www.edureka.co
  • 23. What phases does a Clean Lifecycle consist?19. The clean lifecycle consists of the following phases − • pre-clean • clean • post-clean www.edureka.co
  • 24. What phases does a Site Lifecycle consist?20. The phases in Site Lifecycle are − • pre-site • site • post-site • site-deploy www.edureka.co
  • 25. Copyright © 2017, edureka and/or its affiliates. All rights reserved. www.edureka.co
  • 27. What is a Maven Repository?21. A repository is a place i.e. directory where all the project jars, library jar, plugins www.edureka.co
  • 28. What are the types of Maven repositories?22. Maven repository are of three types: local, central, remote www.edureka.co
  • 29. What is the default location for your local repository? 23. ~/m2./repository www.edureka.co
  • 30. What is Build Profile?24. A Build profile is a set of configuration values which can be used to set or override default values of Maven build www.edureka.co
  • 31. What are different types of Build Profiles?25. • Per Project • Per User • Global www.edureka.co
  • 32. How can you activate profiles?26. A Maven Build Profile can be activated in five ways www.edureka.co
  • 33. What is the sequence in which Maven searches for dependency libraries? 27. There are 4 steps in which Maven searches for dependenies www.edureka.co
  • 34. When does Maven use External Dependency concept? 28. Maven dependency management uses concept of Maven Repositories (Local, Central, Remote). www.edureka.co
  • 35. What are the things you need to define for each external dependency? 29. External dependencies (library jar location) can be configured in pom.xml in same way as other dependencies. www.edureka.co
  • 36. What are the types of Maven Plugins?30. Maven provides following two types of Plugins − Build plugins and Reporting plugins www.edureka.co
  • 37. Why are Maven Plugins used?31. Maven Plugins are used to − • create jar file. • create war file. • compile code files. • unit testing of code. • create project documentation. • create project reports. www.edureka.co
  • 38. What is Archetype?32. Archetype is a Maven plugin whose task is to create a project structure as per its template. www.edureka.co
  • 39. What is the command to create a new project based on an archtype? 33. mvn archetype:generate www.edureka.co
  • 40. What is SNAPSHOT in Maven?34. SNAPSHOT is a special version that indicates a current development copy. www.edureka.co
  • 41. What is difference between Snapshot and Version?35. In case of Version, if Maven once downloaded the mentioned version say data-service:1.0, it will never try to download a newer 1.0 available in repository. www.edureka.co
  • 42. What is transitive dependency in Maven?36. Transitive dependency means to avoid needing to discover and specify the libraries that your own dependencies require, and including them automatically. www.edureka.co
  • 43. What does dependency management mean in the context of transitive dependency? 37. It means to directly specify the versions of artifacts to be used when they are encountered in transitive dependencies. www.edureka.co
  • 44. Does Maven determine what version of dependency will be used when multiple version of an artifact are encountered? If yes, How? 38. Maven determines what version of a dependency is to be used when multiple versions of an artifact are encountered. www.edureka.co
  • 45. What is dependency scope? Name all the dependency scope 39. Dependency scope includes dependencies as per the current stage of the build. Various dependency scopes are – compile, provided, runtime, test, system and import. www.edureka.co
  • 47. What is the minimal set of information for matching a dependency references against a dependencyManagement section ? 40. {groupId,artifactId,type,classifier}. www.edureka.co
  • 48. Copyright © 2017, edureka and/or its affiliates. All rights reserved. www.edureka.co
  • 49. How do you reference a property defined in your pom.xml file? 41. To reference a property defined in your pom.xml, the property name uses the names of the XML elements www.edureka.co
  • 50. What are the default values for packaging element? If there is no packaging element defined,What is the default value for that? 42. Some of the valid packaging values are jar, war, ear and pom. www.edureka.co
  • 51. What is the use of execution element in pom file?43. The <execution> element contains information's required for the execution of a plugin. www.edureka.co
  • 52. What is a project's fully qualified artifact name?44. <groupId>:<artifactId>:<version> www.edureka.co
  • 53. What are the benefit of storing JARS/external dependencies in local repository instead of remote one? 45. It uses less storage, it makes checking out project quicker, non need for versioning JAR files. www.edureka.co
  • 54. How can you build your project offline?46. Use the command − mvn o package. www.edureka.co
  • 55. What is a system dependency?47. Dependency with scope system are always available and are not looked up in repository, they are usually used to tell Maven about dependencies which are provided by the JDK or the VM. www.edureka.co
  • 56. What is the use of optional dependency?48. Any transitive dependency can be marked as optional using "optional" element. www.edureka.co
  • 57. What is a Mojo?49. A mojo is a Maven plain Old Java Object. Each mojo is an executable goal in Maven, and a plugin is a distribution of one or more related mojos. www.edureka.co
  • 58. What are steps involved in project deployment?50. There are 6 steps involved in project deployment www.edureka.co