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
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…