2. Outline
• Introduction to Maven
• Example 1 - simple case
– build jar with command
– build jar with maven
• Example 2 - complex case
– optimize POM
• Maven Repository
• Maven Project on Jenkins
4. Introduction to Maven
• What is maven
– A more formal definition of Apache Maven: Maven is a
project management tool which encompasses a project
object model, a set of standards, a project lifecycle, a
dependency management system, and logic for executing
plugin goals at defined phases in a lifecycle.
• Convention over Configuration
– Maven concept is "Convention over Configuration". Maven
provides default values for the project's configuration.
Systems, libraries, and frameworks should assume
reasonable defaults. Without requiring unnecessary
configuration, systems should "just work"
Ref: apche Maven
14. Plugin and Goal
• Maven is - at its heart - a plugin execution framework; all work is
done by plugins(Plugin is a collection of one or more goals).
Looking for a specific goal to execute? This page lists the core
plugins and others. There are the build and the reporting plugins:
– Build plugins will be executed during the build and they should
be configured in the <build/> element from the POM.
– Reporting plugins will be executed during the site generation
and they should be configured in the <reporting/> element from
the POM/
15. Lifecycle
• A build lifecycle is an organized
sequence of phases that exist to
give order to a set of goals.
Those goals are chosen and
bound by the packaging type of
the project being acted upon.
There are three standard
lifecycles in Maven: clean, default
(sometimes called build) and site.
31. Maven repository
• Open Source:
– Apache Archiva
– JFrog Artifactory Open Source
– Sonatype Nexus OSS
• Commercial:
– JFrog Artifactory Pro
– Sonatype Nexus Pro
Ref: Best Practice - Using a Repository Manager