11.6. 列出活动的Profile

Maven profile可以通过pom.xmlprofiles.xml~/.m2/settings.xml,或者${M2_HOME}/conf/settings.xml定义。由于有四个层次,除了记住哪个文件中定义了哪个profile,没什么好的方式可以了解某个特定项目可用的profile。为了更方便的了解某个项目可用的profile,以及它们是在哪里定义的,Maven Help插件定义了一个目标,active-profiles,它能列出所有激活的profile,以及它们在哪里定义。你可以如下运行active-profiles目标:

$ mvn help:active-profiles
Active Profiles for Project 'My Project':

The following profiles are active:

 - my-settings-profile (source: settings.xml)
 - my-external-profile (source: profiles.xml)
 - my-internal-profile (source: pom.xml)