O'Reilly logo

Apache Maven Cookbook by Raghuram Bharathan

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 Maven profiles

Maven is designed to create portable builds that are expected to work across different platforms and in various runtime environments.

Now, there may be situations where you need to build the same project differently. For instance, you may need to build a project differently for the purpose of staging and production. You may not want to build a project that requires a Linux library on Windows.

How to do it...

Let's understand Maven profiles by performing the following steps:

  1. Open settings.xml in the conf subfolder of your Maven installation (as specified in M2_HOME).
  2. View the commented section of profiles.

How it works...

Maven provides three type of profiles:

  • Per Project profile as defined in the pom file of the project
  • Per ...

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