Maven Profile Trigger

| | Comments (0) | TrackBacks (0)
Profiles are Maven's way of supporting different runtime configurations in the build lifecycle. They can be activated in several different ways e.g. by a particular value of a system property. While you can trigger a profile by setting the respective system property in the mvn commandline e.g.
  
     mvn install -Dappserver=jboss
it is   n o t   possible to use a maven property defined inside the pom. That's not allowed because pom defined properties can themselves be changed inside a profile.
As you can imagine in a multi module project this fact can get extremely annoying: you execute multiple goals and always have to specify the same property again and again. Potentially you destroy the whole project state if you accidentally forget to provide it.
Fortunately there is a simple yet effective way to help you out of this situation: adding the required property to the  MAVEN_OPTS environment variable. It's that easy...

0 TrackBacks

Listed below are links to blogs that reference this entry: Maven Profile Trigger.

TrackBack URL for this entry: http://www.innoq.com/mt4/mt-tb.cgi/2438

Leave a comment

About this Entry

This page contains a single entry by Arnd Kleinbeck published on March 2, 2008 8:00 PM.

Maven Enforcer Plugin was the previous entry in this blog.

Launching JBoss User Group Munich is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.0