Apache Maven

Get Started. It's Free
or sign up with your email address
Rocket clouds
Apache Maven by Mind Map: Apache Maven

1. POM

1.1. What?

1.1.1. Project Object Model(POM)

1.1.2. it is a Maven project configuration file

1.1.3. is an XML file

1.1.4. located/placed in base dir of project

1.1.5. Maven reads pom.xml and executes a goal to build project

1.2. Elements*

1.2.1. project

1.2.2. modelVersion

1.2.3. groupId

1.2.4. artifactId

1.2.5. version

1.3. Configuration

1.3.1. Dependencies

1.3.1.1. Transitive Dependencies

1.3.1.2. Scope

1.3.1.2.1. compile

1.3.1.2.2. provided

1.3.1.2.3. runtime

1.3.1.2.4. test

1.3.1.2.5. system

1.3.1.2.6. import

1.3.1.3. Structure in pom.xml

1.3.1.3.1. <dependencies> <dependency> <groupId>org.scala-lang</groupId> <artifactId>scala-library</artifactId> <version>${scalaVersion}</version> </dependency> <dependencies>

1.3.2. Plugins

1.3.3. Goals

1.3.4. Build Profiles

1.4. Super POM

1.4.1. *POMs that extend a parent POM inherit certain values from that parent(just like Inheritance in Java). *All Project Object Models inherit from a base Super POM

1.4.2. General Dependencies

1.4.3. Def. of version numbers

1.4.4. General plugin and extensions

2. Repositories

2.1. What?

2.1.1. Maven searches for dependencies in the repositories

2.1.2. is a place/directory of packaged JAR files, project jars, library jar, plugins or any other project specific artifacts are stored

2.1.3. maven Searches first in Local then Central then Remote

2.2. Local

2.3. Central

2.4. Remote

3. Build Life Cycle

3.1. clean

3.1.1. phases

3.1.1.1. pre-clean

3.1.1.1.1. mvn pre-clean

3.1.1.2. clean

3.1.1.2.1. mvn clean or mvn clean:clean(plugin included in pom)

3.1.1.3. post-clean

3.1.1.3.1. mvn post-clean

3.2. default/build

3.2.1. phases

3.2.1.1. validate

3.2.1.1.1. mvn validate

3.2.1.2. compile

3.2.1.2.1. mvn compile or mvn compiler:compile(include plugin)

3.2.1.3. test

3.2.1.3.1. mvn test or mvn surefire:test(include plugin in pom)

3.2.1.4. package

3.2.1.4.1. "mvn package" or mvn jar:jar/mvn war:war etc

3.2.1.5. verify

3.2.1.5.1. mvn verify

3.2.1.6. install

3.2.1.6.1. mvn install

3.2.1.7. deploy

3.2.1.7.1. mvn deploy

3.3. site

3.3.1. phases

3.3.1.1. pre-site

3.3.1.2. site

3.3.1.2.1. mvn site or mvn site:site(include plugin in pom.xml)

3.3.1.3. post-site

3.3.1.4. site-deploy

3.3.1.4.1. mvn site-deploy or mvn site:deploy(with plugin included in pom.xml)

3.3.2. Generated documentation under target/site

4. Maven vs ANT vs Gradle

5. Common tasks

5.1. mvn clean

5.2. mvn package

5.3. mvn clean package

5.4. mvn clean install

5.5. mvn plugin:goal

5.5.1. mvn archetype:generate

5.5.2. mvn compiler:compile

5.5.3. mvn jar:jar

5.5.4. mvn tomcat7:run

5.5.5. mvn jetty6:run

5.5.6. mvn dependency:tree

5.5.7. mvn surefire:test

6. Standard Project Structure

7. What is Maven?

7.1. BUILD management TOOL for Java projects

7.2. manages a project's build, reporting and documentation

7.3. Features?

7.3.1. quick project setup

7.3.2. standard directory structure

7.3.3. Adds Jars/Dependencies/libraries automatically(dependency management)

7.3.4. build multi-module projects

7.3.5. IDE Integration

7.3.5.1. Eclipse

7.3.5.1.1. mvn eclipse:eclipse

7.3.5.2. IntelliJ

7.3.5.2.1. mvn idea:idea

8. Installation

8.1. Windows

8.2. Linux

8.3. OSX

9. Define Plugin, Phases, Goals

9.1. Life cycle is a sequence of named phases.

9.2. Phases executes sequentially. Executing a phase means executes all previous dependent phases, life cycles

9.3. Plugin are used to add additional collection of goals.

9.4. Goal is like an action in Plugin. So if plugin is a class, goal is a method

10. References

10.1. Links

10.1.1. https://dzone.com/refcardz/apache-maven-2

10.2. Books

11. New Topic