Maven

Categories: Java Maven Build Tools
Course Length: 3 Days

Maven is the de-facto build-tool in Java and Spring. Gradle comes in at a close second. It was one of the first, if not the first to make use of downloaded dependencies and calculating hashes for verification. It manages an entire development lifecycle, and enjoys a wide array of plugins from the community.

2560px Apache Maven logo.svg

Introduction to Maven

Maven is a powerful build automation and project management tool primarily used for Java projects. It streamlines software builds, reporting, and documentation through a declarative XML configuration model. Maven promotes convention over configuration, enabling teams to manage dependencies, build lifecycles, and plugins efficiently.

Maven History

Maven originated from the Apache Jakarta Turbine project, where developers needed a standardized build system. First released in 2004, Maven aimed to replace complex Ant scripts with a more maintainable, reproducible, and convention-based tool. Over the years, Maven evolved into the de facto build tool for enterprise Java development.

Maven Architecture

Maven’s architecture revolves around: • Project Object Model (POM): A declarative XML file (pom.xml) that describes a project. • Build Lifecycles: Defined phases that automate the steps of compiling, testing, packaging, and deploying. • Plugins: Executable components that perform tasks (e.g., compiling code, generating reports). • Repositories: Local and remote artifact storage for dependencies and plugins.

  • Introduction to Maven

    • Maven History

    • Maven Architecture

    • Maven Installation

    • Maven Configuration

  • Maven, the Plugin Execution Framework

    • Running Maven as a Plugin

    • groupID, artifactID, version

    • Creating a Project

    • Project Object Model

    • Reviewing the Maven Project

  • Maven Build Lifecycle

    • compile

    • test-compile

    • test

    • package

    • process-resources

    • process-test-resources

    • install

    • deploy

  • Maven Clean Lifecycle

    • pre-clean

    • clean

    • post-clean

  • Super POM

    • help:effective-pom

    • Reviewing the Effective POM

  • Versioning

  • Manipulating Projects

  • Properties

    • Project Properties

    • Environmental Properties

    • Settings Properties

    • User-Defined Properties

  • Dependencies

    • Setting Dependencies

    • Versioning

    • Transitive Dependencies

    • Optional Dependencies

  • Plugin Configuration and Manipulation

    • Compiler Plugin

    • Surefire Plugin

    • Jar Plugin

    • Assembly Plugin

    • Report Plugins

  • Resource Filtering

    • Including Resources

    • Excluding Resources

  • Profiles

    • Defining Profiles

    • Activating Profiles

  • Multimodule Projects

  • Web Projects

  • Plugin Groups

  • Deploying to Artifactory or Nexus