Vous êtes sur la page 1sur 11

10/6/2017 Maven Interview Questions

(https://tekslate.com/)

Maven (https://tekslate.com/category/maven/) Article

Maven Interview Questions


By Soujanya Naganuri (https://tekslate.com/author/soujanya/) July 30, 2016 Total Views: 398

(http://www.facebook.com/share.php?u=https://tekslate.com/interview+questions-in-maven/)
(http://twitter.com/share?url=https://tekslate.com/interview+questions-in-maven/)
(https://plus.google.com/share?url=https://tekslate.com/interview+questions-in-maven/)
(http://www.linkedin.com/shareArticle?mini=true&url=https://tekslate.com/interview+questions-in-
maven/&title=Maven Interview Questions&source=https://tekslate.com)

https://tekslate.com/interview+questions-in-maven/ 1/11
10/6/2017 Maven Interview Questions

Explain what is Maven? How does it work?

Maven is a project management tool. It provides the developer a complete build lifecycle framework. On executing Maven
commands, it will look for POM file in Maven; it will run the command on the resources described in the POM.

List out what are the aspects does Maven Manages?

Maven handles following activities of a developer

-Build

-Documentation

-Reporting

-Dependencies

-SCMs

-Releases

-Distribution

-Mailing list

Mention the three build lifecycle of Maven?

-Clean: Cleans up artifacts that are created by prior builds

-Default (build): Used to create the application

-Site: For the project generates site documentation

Explain what is POM?

In Maven, POM (Project Object Model) is the fundamental unit of work. It is an XML file (https://tekslate.com/steps-create-xml-
source-qualifier-transformation-informatica/) which holds the information about the project and configuration details used to build
a project by Maven.

Explain what is Maven artifact?

Usually an artifact is a JAR file which gets arrayed to a Maven repository. One or more artifacts a maven build produces such as
compiled JAR and a sources JAR.

Each artifact includes a group ID, an artifact ID and a version string.

Explain what is Maven Repository? What are their types?

A Maven repository is a location where all the project jars, library jars, plugins or any other particular project related artifacts are
stored and can be easily used by Maven (https://tekslate.com/maven-training).

Their types are local, central and remote.

Why Maven Plugins are used?

Maven plugins are used to

-Create a jar file

-Create war file

-Compile code files

-Unit testing of code

https://tekslate.com/interview+questions-in-maven/ 2/11
10/6/2017 Maven Interview Questions

-Documenting projects

-Reporting

Inclined to build a profession as Maven Developer? Then here is the blog post on
Online Maven Training (https://tekslate.com/maven-training).

List out what are the build phases in Maven?

Build phases in Maven are

-Validate

-Compile

-Test

-Package

-Install

-Deploy

List out the build, source and test source directory for POM in Maven?

-Build = Target

-Source = src/main/java

-Test = src/main/test

List out what are the Mavens order of inheritance?

The mavens order of inheritance is

-Parent Pom

-Project Pom

-Settings

-CLI parameters

Explain how you can produce execution debug output or error messages?

To produce execution debug output you could call Maven with X parameter or e parameter.

Explain how to run test classes in Maven?

To run test classes in Maven, you need surefire plugin, check and configure your settings in setting.xml and pom.xml for a
property named test.

What are the advantages of Maven?

-No need to add jar file in each project

-Creates right directory structure

-Builds and deploys the project

What it does?

Maven simplifies the above mentioned problems. It does mainly following tasks.

It makes a project easy to build

https://tekslate.com/interview+questions-in-maven/ 3/11
10/6/2017 Maven Interview Questions

It provides uniform build process (maven project can be shared by all the maven projects)

It provides project information (log document, cross referenced sources, mailing list, dependency list, unit test reports etc.)

It is easy to migrate for new features of Maven

Apache Maven helps to manage

-Builds

-Documentation

-Reporing

-SCMs

-Releases

-Distribution

Interested in mastering Maven? Learn more about Maven Tutorials (https://tekslate.com/tutorials/maven/) in this blog post.

What features should a build tool have?

A build tool should have:

-Compile java code and build jar, war and ear files for deployment and release.

-Versioning and dependency management

-Run tests and report test results

-Run code quality check with Sonar, Checkstyle, Findbugs, etc.

-Environment property substitution

-Files generations ( wsdl, AspectJ, XSL,etc)

-Support for cross platform (UNIX Windows (https://tekslate.com/tutorials/unixlinux/)) and IDEs(eclipse, Netbeasn, Intellij)

-Proper documentation and support.

What is a transitive dependency in Maven?

Transitive dependency in Maven means that it is not necessary to discover and specify the libraries that our own dependencies
require, Maven includes them automatically.

What is the difference between version and SNAPSHOT ?

Maven will download always the specified version. In case of SNAPSHOT Maven will download the latest SNAPSHOT.

What is a Mojo?

A mojo is a Maven plain Old Java Object . Mojo is associated with a Maven goal. A custom plugin is a set of related Mojos (or
goals) in a single plugin artifact.

What does the Maven command mvn clean do?

This command erase the target directory with all the build data before starting the building process.

What are the phases of the Maven Build Lifecycle?

The phases of the Maven Build Lifecycle are:

-Validate

https://tekslate.com/interview+questions-in-maven/ 4/11
10/6/2017 Maven Interview Questions

-Compile

-Test

-Package

-Integration-tests

-Verify

-Install

-Deploy

Summary

Reviewer Ram

Review Date 2016-07-30

Reviewed Item Maven Interview Questions

Author Rating

Enroll NowMeet
() the author LEAVE A MESSAGE

SOUJANYA NAGANURI (https://tekslate.com/author/soujanya/)

At TekSlate, we are trying to create high quality tutorials and articles, if you think any
information is incorrect or want to add anything to the article, please feel free to get in touch with
us at info@tekslate.com, we will update the article in 24 hours.

0 Responses on Maven Interview Questions"


(https://tekslate.com/interview+questions-in-maven/feed/)

Leave a Message
Your email address will not be published. Required fields are marked *

Name*

Email*

Website

Comment

https://tekslate.com/interview+questions-in-maven/ 5/11
10/6/2017 Maven Interview Questions

Comment

POST COMMENT

Latest Tutorials Browse all 153 Tutorials (/tutorials/)


(/tutorials/)

Apache Flume Tutorials


Welcome to Apache Flume Tutorials. The objective of these tutorials is to provide in depth understand

(https://tekslate.com/tutorials/apache-flume/)

Amazon AWS Tutorials


Welcome to AWS Tutorials. The objective of these tutorials is to provide in depth understand

(https://tekslate.com/amazon-aws-tutorials/)

Data Modeling Tutorials


Welcome to Data Modeling Tutorials. The objective of these tutorials is to gain understanding of

(https://tekslate.com/tutorials/datamodeling/)

Home (https://tekslate.com/) About (https://tekslate.com/about/) Trainings (//tekslate.com/courses/)Site Disclaimer


Free Tutorials (https://tekslate.com/tutorials/) Contact Us (https://tekslate.com/support/)(https://tekslate.com/disclaimer/), Copyright
2016 - All Rights Reserved.

https://tekslate.com/interview+questions-in-maven/ 6/11
10/6/2017 Maven Interview Questions

https://tekslate.com/interview+questions-in-maven/ 7/11
10/6/2017 Maven Interview Questions

https://tekslate.com/interview+questions-in-maven/ 8/11
10/6/2017 Maven Interview Questions

https://tekslate.com/interview+questions-in-maven/ 9/11
10/6/2017 Maven Interview Questions

https://tekslate.com/interview+questions-in-maven/ 10/11
10/6/2017 Maven Interview Questions

https://tekslate.com/interview+questions-in-maven/ 11/11

Vous aimerez peut-être aussi