I\'ve set profiles in a pom.xml, like shown as follows:
profileId1
With maven 2.2.1 and later, I was able to get the ID of the first active profile using:
${project.activeProfiles[0].id}
Of course this fails if there is not a least one active profile.
Using the
${project.profiles[0].id}
as suggested by Pascal did not work for me.
Hint: While investigating this, I really started to love mvn help:evaluate.