Maven Flashcards

1
Q

What is Maven in general?

A

Maven is a project management and comprehension tool. It provides a complete build life-cycle framework.

Maven allows developers to automate a project’s build infrastructure in almost no time at all.

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

What is the POM in Maven?

A

POM stands for Project Object Model. It is the fundamental unit of work in Maven.

It will always be in the base directory in the maven project as pom.xml.

pom.xml contains dependencies, plugins, goals, and build profiles

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

What are phases of the default lifecycle?

A

Phases are:

Validate, compile, test, package, integration, verify, install, deploy.

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

What does the command mvn clean do?

A

Cleans maven project, removes target directory with all build data before starting build process.

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

What is a dependency?

A

A dependency is an artifact that Maven includes as part of the build.

Same thing as including .jar files in your classpath in a normal eclipse build.

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

1) What is a Maven repository?

2) What are the local and central repositories

A

1) It is a directory where all project jars, libraries, plugins, and other artifacts are stored so Maven can easily access them.
2) Local repository is everything saved to machine. If Maven doesn’t find dependency in Local, it will search the central repo using a URL.

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

What is the default location of your local repository?

A

~/.m2/repository

This is changed in the conf/settings.xml file in Maven directory

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

How to deploy a web app with Maven?

A

This is done by using weblogic or tomcat maven plugins. This info must be included in the pom.xml file.

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

What is a Snapshot?

A

A snapshot is a special version that indicates a current development copy. Maven will check for new snapshots for every build.

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