Technical Leader

Maven Profiles

I just wanted to make a quick post relating to Maven profiles. I was trying some new things about with Maven the other day and decided to put these into a profile as to not disturb the normal build process. Upon performing some trial and error tests, I was getting some strange results. I wasted to much time on figuring out what the problem was, but for Maven it expects multiple profiles to be specified such as the following:

mvn -Pprofile1,profile2

I made the mistake of specifying them as multiple -P arguments. Such as the following … this is the wrong way:

mvn -Pprofile1 -Pprofile2

Maven 2.0.8 (I haven’t check on 2.0.9) does not give any indication of an error or warning from what I can tell.

Do not make the same mistake :)

Update - It looks as though Maven 2.0.10 will correct this issue.