我正在学习MAVEN配置文件,有一个关于使用变量设置属性的问题。目前,我正在使用以下配置:
<profile>
<id>Action type D restriction</id>
<activation>
<property>
<name>actionType</name>
<value>D</value>
</property>
</activation>
<properties>
<restriction.actionType>D</restriction.actionType>
</properties>
</profile>
<profile>
<id>Action type W restriction</id>
<activation>
<property>
<name>actionType</name>
<value>W</value>
</property>
</activation>
<properties>
<restriction.actionType>W</restriction.actionType>
</properties>
</profile>
我的问题是:是否有可能使用一个带有变量的配置文件来完成相同的工作,例如:
我的问题是这个; 是否可以以某种方式使用具有变量的一个配置文件来执行相同的任务,类似于:
<profile>
<id>Action type restriction</id>
<activation>
<property>
<name>actionType</name>
<value>[D,W]</value>
</property>
</activation>
<properties>
<restriction.actionType>${project.profiles.profile.activation.value}</restriction.actionType>
</properties>
</profile>
或类似的内容。