Maven Flashcards

1
Q

What is Maven?

A

It is a project management tool that makes the developer’s life easy by downloading the dependencies and making the build process faster.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is POM?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What type of configuration can you provide in POM?

A
  • project dependencies
  • project version
  • plugins
  • goals
  • build profiles
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What do you need to have to create a pom file?

A

groupID
artifactID
version

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a build lifecycle?

A

A well defined sequence of phases which define the order in which the goals are to be executed.
phase = stage in life cycle.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Name the four lifecycles

A
  1. prepare resources
  2. compile
  3. package
  4. install
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What happens in the first lifecycle on build lifecycle?

A

Resource copying can be customized in this phase.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What happens in the compile

A

Source code compilation is done in this phase.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

package

A

This phase creates the JAR / WAR package as mentioned in packaging in POM.xml.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

install

A

This phase installs the package in local / remote maven repository.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a build profile?

A

A Build profile is a set of configuration values which can be used to set or override default values of Maven build.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Name the three types of build profile

A
  • 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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How can you activate the profile?

A
  • Explicitly using command console input.
  • Through maven settings.
  • Based on environment variables (User/System variables).
  • OS Settings (for example, Windows family).
  • Present/missing files.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is maven repository?

A

A directory where all project jars, library jar, plugins or any project specific artifacts are stored and used by Maven easily

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Maven plugins

A
  • used to create jar, war files
  • compile codes
  • unit test
  • create project documentations
  • create project report
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What plugins have u used?

A

surefire - to do the junit tests

war - to create the war files