我想做的是,基于使用中的Maven概要文件,以某种方式替换属性文件中resources.location的值。这有可能吗?
在你的
ApplicationResources.properties
,声明要替换的令牌,如下所示:
resources.location=${your.location}
在POM中,添加一个
<filtering>
<resource>
把它设置成这样:
<project>
...
<build>
...
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
...
</resources>
...
</build>
...
</project>
<your.location>
中的元素
<properties>
每个配置文件中的元素:
<project>
...
<profiles>
<profile>
<id>my-profile</id>
...
<properties>
<your.location>/home/username/resources</your.location>
</properties>
...
</profile>
...
</profiles>
</project>
here
和
here