[
https://issues.apache.org/jira/browse/MSHARED-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16734231#comment-16734231
]
Michael Osipov commented on MSHARED-793:
----------------------------------------
I have the exact same case at work. I solved it that way:
The base application has a {{<app-name>.properties}} file which can be
overridden with {{<app-name>-custom.properties}} then read by Spring with:
{code}
<beans:beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<context:property-placeholder properties-ref="config" />
<beans:bean id="config"
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<beans:property name="locations">
<beans:array>
<beans:value>classpath:com/company/webapp/build.properties</beans:value>
<beans:value>classpath:app.properties</beans:value>
<beans:value>classpath:app-custom.properties</beans:value>
<beans:value>file:${catalina.base}/conf/app-secrets.properties</beans:value>
</beans:array>
</beans:property>
<beans:property name="ignoreResourceNotFound" value="true" />
</beans:bean>
</beans:beans>
{code}
> Support for default value
> -------------------------
>
> Key: MSHARED-793
> URL: https://issues.apache.org/jira/browse/MSHARED-793
> Project: Maven Shared Components
> Issue Type: New Feature
> Components: maven-filtering
> Affects Versions: maven-filtering-3.1.2
> Reporter: Jean-Charles Manoury
> Priority: Major
> Labels: pull-request-available
>
> The goal is to manage default value like ${toto:tutu} where tutu is used when
> no value for toto is found.
> It is the same behavior as Spring's
> [PropertyPlaceholderConfigurer|https://www.mkyong.com/spring/spring-propertyplaceholderconfigurer-example/]
> This will make properties files from a Spring project compatible with
> maven-filtering.
> A pull request had been created on Github :
> https://github.com/apache/maven-filtering/pull/1
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)