IllegalArgumentException with Spring PropertyPlaceholderConfigurer properties flag
<p>In my app I am using SpringBoot and the Spring Batch(and admin) frameworks. I am also using an application.yaml file to store all of the Properties I need. I am having trouble with Properties because there is a <code>PropertyPlaceholderConfigurer</code> bean created in SpringBatchAdmin that has the flag <code>ignoreUnresolvablePlaceholders</code> set to <code>false</code>. Here is the aforementioned bean:</p>

<pre><code>&lt;bean id="placeholderProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
        &lt;property name="locations"&gt;
            &lt;list&gt;
                &lt;value&gt;classpath:/org/springframework/batch/admin/bootstrap/batch.properties&lt;/value&gt;
                &lt;value&gt;classpath:batch-default.properties&lt;/value&gt;
                &lt;value&gt;classpath:batch-${ENVIRONMENT:hsql}.properties&lt;/value&gt;
            &lt;/list&gt;
        &lt;/property&gt;
        &lt;property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" /&gt;
        &lt;property name="ignoreResourceNotFound" value="true" /&gt;
        &lt;property name="ignoreUnresolvablePlaceholders" value="false" /&gt;
        &lt;property name="order" value="1" /&gt;
    &lt;/bean&gt;
</code></pre>

<p>My problem is that currently Spring searches in these 3 files to read ALL OF the properties that are fetched using the <code>@Value</code> annotation. So what happens is that I have other dependencies that have declared their own Properties and Spring is forcing me to put these Properties inside one of the 3 files declared in the <code>PropertyPlaceholderConfigurer</code> bean created in SpringBatchAdmin. </p>

<p>So, for example, the following class/bean:</p>

<pre><code>@Component
public class Example{
   @Value("${find.me}")
   private String findMe;

   ...
}
</code></pre>

<p>will have to look in the following 3 files:</p>

<pre><code>batch.properties 
batch-default.properties 
batch-sqlserver.properties
</code></pre>

<p>and if the property <code>find.me</code> is not in one of these files, then I get the following exception:</p>

<pre><code>java.lang.IllegalArgumentException: Could not resolve placeholder 'find.me' in string value "${find.me}"
</code></pre>

<p>I want to add that the problem DOES NOT come from using yaml or Spring not finding the "find.me" property, since if I don't use SpringBatchAdmin that creates the <code>PropertyPlaceholderConfigurer</code> the property "find.me" is effectively found in my <code>application.yaml</code> file. </p>

<p>Also, I cannot modify the <code>PropertyPlaceholderConfigurer</code> in question because it comes from an external source(not mine, but SpringBatchAdmin).</p>

<p>How can I solve this?</p>