Home / Interview / Maven :: General Questions

Interview :: Maven

1) What is Maven?

Maven is a project management tool. It is based on POM (Project Object Model).

2) What aspects are managed by Maven?
  • Builds
  • Documentation
  • Reporting
  • SCMs
  • Releases
  • Distribution
3) What are the advantages of Maven?
  • No need to add jar file in each project
  • Creates right directory structure
  • Builds and deploys the project
4) What is the command to check the maven version?

Type the following command on console to know the maven version.

5) What does the build tool?
  • Generates source code (if the auto-generated code is used)
  • Generates documentation from source code
  • Compiles source code
  • Packages compiled code into a JAR or ZIP file
  • Installs the packaged code in the local repository, server repository, or central repository
6) What is the difference between Ant and Maven?
It is a toolbox.It is a framework.
It is mainly a build tool.It is mainly a project management tool.
There is no life cycle.There is alife cycle.
Ant doesn't have formal conventions.Maven has a convention to place source code, compiled code etc.
Ant is procedural.Maven is declarative.
The ant scripts are not reusable.The Maven plugins are reusable.
7) Why is the use of the profile required in Maven?

For providing probability to projects, we use profiles.

8) What is the syntax for offline project creation?

The syntax for project creation is:

mvn o packg.

9) How is the propagation of plugins to child POMs stopped?

It can be done using the following syntax:

10) What is the use of the exclusion element?

The element is used to exclude dependencies.