Maven
Profiles Commands
Use Maven profiles for environment-specific builds. Activate profiles for dev, staging, and production with different configurations, dependencies, and plugin settings.
13 commands
Pro Tips
Activate a profile: 'mvn package -Pproduction' — use different configs per environment.
Use 'mvn help:active-profiles' to see which profiles are currently active and why.
Auto-activate profiles based on OS, JDK version, or environment variables with '<activation>' blocks.
Common Mistakes
Too many profiles make builds hard to understand and debug. Keep them minimal and well-documented.
Profiles that change dependencies can cause different builds on different machines. Test all profile combinations.