Getting Started with Apache Maven
3.8 (25 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
401 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Getting Started with Apache Maven to your Wishlist.

Add to Wishlist

Getting Started with Apache Maven

Design and manage simple to complex Java projects effectively using Apache Maven’s project object model
3.8 (25 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
401 students enrolled
Created by Packt Publishing
Last updated 10/2014
Current price: $10 Original price: $85 Discount: 88% off
5 hours left at this price!
30-Day Money-Back Guarantee
  • 2.5 hours on-demand video
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • The video course entails a crisp demonstration of the concepts of building projects through Apache Maven backed by practical and illustrative examples.
View Curriculum
  • Getting Started with Apache Maven is intended for Java developers. Knowledge of ANT and Maven would be helpful, but is not essential.

Getting Started with Apache Maven will introduce you to the world of synergized development in the Maven ecosystem. The course logically explains the various concepts of the tool, and shows how to proceed from simple assignments to complex ones.

Maven is not simply a tool to invoke compilers and utilities, but it is also an approach to easily constructing your project by accessing its ever-expanding world of tools and libraries.

You will learn how to pull in dependencies simply by specifying their coordinates, how to customize your lifecycle with plugins, and see how easy it can be to create a project website. You will see how to generate reports on your code that will enable understanding and will let you know when your developers are running into problems. You will understand how to scale up from simple projects to multi-module ones.

This video course walks you through the steps by presenting examples, starting with very basic ones, and growing to more elaborate ones once you have mastered the basics.

About the Author

Russell Gold has been a Java developer since 1996 and is the author of the open-source project, HttpUnit, as well as a handful of smaller open source projects. He is also a committer on the Codehaus Mojo project, where he maintains the idlJ and RMIC plugins.

He has spent the major part of his career looking for better ways to develop software, is a staunch advocate of agile development, and has embraced Maven as a major advance in build philosophy and technology. Russell is currently employed by Oracle.

I would like to express gratitude to my wife Gwen, for her patience as I spent many hours working on this project, as well as to my boss and co-workers who have offered encouragement and feedback.

Who is the target audience?
  • Getting Started with Apache Maven is intended for Java developers. Knowledge of ANT and Maven would be helpful, but is not essential.
Students Who Viewed This Course Also Viewed
Curriculum For This Course
40 Lectures
5 Lectures 18:28

With all the build systems available, it can be hard to understand what makes Maven special. Understanding some history can make this clearer.

Introduction to Apache Maven

Before getting started, you need to install Maven. A simple procedure is described.

Installing Apache Maven

All Maven artifacts are referred to using Maven Coordinates. This is the organizational structure of the repository.

Understanding the Maven Repository

Maven's approach to builds is based on the lifecycle. Examining a build is a way to start seeing how it works.

Understanding the Maven Lifecycle

Maven uses plugins to perform build steps. Plugin mojos are identified by their associated goals and bound to build phases.

Understanding the Role of Plugins
5 Lectures 14:23

Add dependencies to a project by specifying their Maven coordinates. Maven will do the rest.

Introducing Maven Dependencies

Some dependencies should only be applied to the test classpaths. The scope element controls this.

Preview 03:06

Using a dependency often means depending on its own dependencies. Maven makes this straightforward.

Maven and Transitive Dependencies

When many projects use the same dependency, Maven can provide a single place to define it for all of them.

Managing Dependencies that All Projects Need – Part 1

When a dependency is used only by a small number of projects, Maven can define a single place to define the versions to use.

Managing Dependencies that All Projects Need – Part 2
5 Lectures 16:13

Sometimes you need to reconfigure a build step. Specify a plugin by coordinates and add the configuration data.

Preview 03:25

You can add steps to a Maven build. Specify a plugin and add an execution element to say what to run and when.

Adding Steps to a Maven Build

Code generation is generally a two-step process: first generate and then compile. Maven requires only one setting.

Code Generation

When many projects use the same plugin, Maven can provide a single place to define it for all of them.

Managing Plugins with a Parent POM

A lot of useful plugins have been written for Maven builds. Learn how to find what's available.

Finding Available Plugins
Controlling the Build
5 Lectures 17:14

Some build values and parameters can change frequently. Build properties allow convenient updating of these values.

Maven Build Properties

Sometimes it is useful to choose which goals will be run during a build. Placing them in a profile allows them to run conditionally.

Maven Profiles

The condition for performing certain actions can depend on the value of a property. Profile activation can be made to depend on a property value.

Profile Activation via Properties

Build behavior may depend on the presence of various environments. Build profiles can be triggered based on files, system, or JDK versions.

Profile Activation via Environment

Some behavior can be specific to a single developer. Controlling definitions can be placed in settings.xml.

Preview 04:43
The Project Website
5 Lectures 18:13

Every important project should have a website. Maven can generate one with little work.

The Basic Website and Reports

One good use of a project website is to monitor the health of the code. Use Maven to add automatically generated code reports to the site.

Preview 03:46

Most website content needs to be defined by the development team. Maven provides a simple syntax to create pages.

Creating Custom Pages

The default appearance of a Maven site is not for every project. Maven allows developers to customize its look.

FAQ (frequently asked question) Pages and Site Appearance

A website needs to be uploaded to a server to be useful. Configure Maven to do this automatically.

Deploying to a Web Server
The Maven Release Process
6 Lectures 18:39

Projects can only use artifacts found in a repository. Maven can upload artifacts in the deploy phase.

Deploying to a Repository

Once an artifact is published, it should not be changed. Snapshots can be published over and over again to test an artifact before releasing it.

Using Snapshots

Releasing software requires a number of steps. Use the Maven release:prepare goal to push and tag the release source to CM.

Preparing for a Release

Once the code to be released is tagged in CM, it needs to be built and published. Use the Maven release:perform goal to do this.

Releasing Maven Artifacts

Open source projects should be published to Maven Central for general availability. There are several requirements that must be met before publishing.

Preparing for an Open Source Release

There are some differences in the process for publishing to Maven Central. Use the repository manager to verify and release artifacts.

Publishing to Maven Central
Multi-module Projects
4 Lectures 12:41

Complex projects generate multiple artifacts, but a Maven project only builds a single artifact. Use inheritance and aggregation to create large projects.

Understanding the Multi-module Project

Large projects can take a long time to build. Use the -rf switch to rebuild from the middle of a project.

Incremental Building with Multiple Modules

Complex projects need complex websites. Understand how the site plugin handles inheritance.

Building a Website for a Multi-module project

Releasing a multi-module project can be cumbersome. Learn about command-line shortcuts.

Releasing the Multi-module Project
Maven Tricks and Patterns
5 Lectures 19:46

Complex projects may require more sophisticated scripting than Maven supports. The antrun plugin allows access to ant from Maven.

Invoking Ant from Maven

An ant script can access artifacts from a Maven repository. Appropriate taskdefs can use Maven coordinates directly.

Accessing Maven Artifacts from Ant

End users don't usually access Maven repositories to obtain programs. Use Maven to create an installer.

Preview 05:20

Functional tests are sometimes created before the code that satisfies them is ready. The failsafe plugin can run them without failing.

Running Functional Tests

Both, the default plugin bindings and transitive dependencies, can cause problems. Use Maven features to turn them off when needed.

Disabling Default Plugin Bindings and Excluding Transitive Dependencies
About the Instructor
Packt Publishing
3.9 Average rating
8,059 Reviews
58,232 Students
686 Courses
Tech Knowledge in Motion

Packt has been committed to developer learning since 2004. A lot has changed in software since then - but Packt has remained responsive to these changes, continuing to look forward at the trends and tools defining the way we work and live. And how to put them to work.

With an extensive library of content - more than 4000 books and video courses -Packt's mission is to help developers stay relevant in a rapidly changing world. From new web frameworks and programming languages, to cutting edge data analytics, and DevOps, Packt takes software professionals in every field to what's important to them now.

From skills that will help you to develop and future proof your career to immediate solutions to every day tech challenges, Packt is a go-to resource to make you a better, smarter developer.

Packt Udemy courses continue this tradition, bringing you comprehensive yet concise video courses straight from the experts.