在pom.xml中我已经集合O配置文件是这样的:Maven - 我可以在配置文件定义中引用配置文件ID吗?
<profile> <id>profileId1</id> <build> <filters> <filter>src/main/filters/profileId1.properties</filter> </filters> // rest of the profile </profile> <profile> <id>profileId2</id> <build> <filters> <filter>src/main/filters/profileId2.properties</filter> </filters> // rest of the profile </profile>
有什么办法,我可以提取这一块的所有配置文件,所以没有必要重复这对于每一个配置文件(也可能拼错它)?
使用'$ {project.activeProfiles [0] .ID}'完全为我工作。您可以确保至少有一个配置文件在一个配置文件的激活块中使用' true activeByDefault>'激活。 –
SimonB
2012-02-14 11:03:14
同样在这里,$ {project.activeProfiles [0] .id}起作用,maven 3.2 – chrismarx 2016-06-13 14:56:58
出于某种原因,它不会提取父pom属性;因此,例如,如果激活2个配置文件,其中一个配置文件来自父项,则只会检索当前项目属性。 – ftkg 2016-12-08 18:08:52