O'Reilly logo

Apache Maven 3 Cookbook by Srirangan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding build profiles

Projects in Maven are generally portable. This is done by allowing configuration within the POM, avoiding all filesystem references, and depending extensively on the local repository to store the required metadata.

However, this isn’t always possible as under some circumstances configuration with filesystem references become unavoidable. For these cases, Maven introduces the concept of build profiles.

Build profiles are specifications made in the POM and can be triggered as and when required. Some ways to trigger profiles are:

  • Explicit command-line trigger
  • Maven settings trigger
  • Environment specific trigger

Explicit command-line trigger

Profiles can be directly triggered through the command line using the -P option. The list ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required