Spring boot, environment specific properties location
<p>I can see many posts regarding environment specific properties, but none of them is quite solving my problem.</p>

<p>I'm working on my spring boot app, which will have say two profiles dev/live.</p>

<p>I want my project to have the following structure:</p>

<pre><code>--deployment
  --dev
    --myapp.properties
  --live
    --myapp.properties
--src
  --main
    --java
    --resources
  --test
    --java
</code></pre>

<p>I know that if I had two <code>application.properties</code> in my resources folder, say <code>application-live.properties</code> and <code>application-dev.properties</code> I'd be able to tell maven which one to pick at application start time using:</p>

<pre><code>Dspring.profiles.active=profile_name
</code></pre>

<p>But I don't like name of this generic properties file. So I found this way to tell the application where to look for profile specific properties in <code>/deployment/&lt;profile&gt;/</code>.</p>

<p>I did it using Maven build task configuration:</p>

<pre><code>&lt;build&gt;
    &lt;resources&gt;
        &lt;resource&gt;
            &lt;directory&gt;deployment/${environment}&lt;/directory&gt;
            &lt;includes&gt;
                &lt;include&gt;*.properties&lt;/include&gt;
                &lt;include&gt;*.xml&lt;/include&gt;
            &lt;/includes&gt;
        &lt;/resource&gt;
    &lt;/resources&gt;
&lt;/build&gt;
</code></pre>

<p>This is going to search for resources in <code>deployment/&lt;profile&gt;</code> and include them. Good thing is that Maven finds the correct environmental property files, but unfortunately it includes them in <code>target/classes/myapp.properties</code> which seems invisible for Spring Boot? How can I tell Maven to place it in the same directory as <code>application.properties</code>or alternately how can I tell Spring Boot to find it where it is at the moment?</p>

<p>Thanks a lot!</p>