Maven Interview Questions

Maven Interview Questions And Answers

What is Maven

Maven is a project management and comprehension tool. Maven provides developers a complete build lifecycle framework. Development team can automate the project’s build infrastructure in almost no time as Maven uses a standard directory layout and a default build lifecycle.

What are the aspects Maven manages?

Maven provides developers ways to manage following −

Builds
Documentation
Reporting
Dependencies
SCMs
Releases
Distribution
mailing list

What are the phases of a Maven Build Lifecycle?

validate − validate the project is correct and all necessary information is available.

compile − compile the source code of the project.

test − test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed

package − take the compiled code and package it in its distributable format, such as a JAR.

integration-test − process and deploy the package if necessary into an environment where integration tests can be run.

verify − run any checks to verify the package is valid and meets quality criteria.

install − install the package into the local repository, for use as a dependency in other projects locally.

deploy − done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.

What is difference between Snapshot and Version?

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. To download the updated code, data-service version is be upgraded to 1.1.

In case of SNAPSHOT, Maven will automatically fetch the latest SNAPSHOT (data-service:1.0-SNAPSHOT) everytime app-ui team build their project.

Inclined to build a profession as Maven Developer? Then here is the blog post on
 Online Maven Training.

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

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 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) 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.

Maven Interview Questions And Answers For Experienced 

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

-Compile

-Test

-Package

-Integration-tests

-Verify

-Install

-Deploy

Summary
Review Date
Reviewed Item
Maven Interview Questions
Author Rating
51star1star1star1star1star

“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"

    Leave a Message

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

    Support


    Please leave a message and we'll get back to you soon.
    Three + 6