Maven Flashcards
What is Maven?
It is a project management tool that makes the developer’s life easy by downloading the dependencies and making the build process faster.
What is POM?
It stands for Project Object Model. It is an xml file that contains information about the project and the various configuration details used by Maven to build the project. It contains goals and plugins as well
What type of configuration can you provide in POM?
- project dependencies
- project version
- plugins
- goals
- build profiles
What do you need to have to create a pom file?
groupID
artifactID
version
What is a build lifecycle?
A well defined sequence of phases which define the order in which the goals are to be executed.
phase = stage in life cycle.
Name the four lifecycles
- prepare resources
- compile
- package
- install
What happens in the first lifecycle on build lifecycle?
Resource copying can be customized in this phase.
What happens in the compile
Source code compilation is done in this phase.
package
This phase creates the JAR / WAR package as mentioned in packaging in POM.xml.
install
This phase installs the package in local / remote maven repository.
What is a build profile?
A Build profile is a set of configuration values which can be used to set or override default values of Maven build.
Name the three types of build profile
- per project defined in the project POM file
- per user defined in the maven setting xml file
- global defined in the maven global setting xml file
How can you activate the profile?
- Explicitly using command console input.
- Through maven settings.
- Based on environment variables (User/System variables).
- OS Settings (for example, Windows family).
- Present/missing files.
What is maven repository?
A directory where all project jars, library jar, plugins or any project specific artifacts are stored and used by Maven easily
Maven plugins
- used to create jar, war files
- compile codes
- unit test
- create project documentations
- create project report