title: spring.profiles.active ist not set to the profile name specified on the command line for the maven build
body: <p>I use Spring Boot 2.1.3.RELEASE and have the following issue:</p>
  
  <p>I use a standard spring boot project created with Spring Initializr.
  I have setup maven resource filtering by specifying the following in the pom.xml:</p>
  
  <pre><code>&lt;build&gt;
  ...
  &lt;resources&gt;
      &lt;resource&gt;
          &lt;directory&gt;src/main/resources&lt;/directory&gt;
          &lt;filtering&gt;true&lt;/filtering&gt;
      &lt;/resource&gt;
  &lt;/resources&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>In the application.properties i have specified the following:</p>
  
  <p><code>spring.profiles.active=@spring.profiles.active@</code></p>
  
  <p>And I have defined the following profiles in the pom.xml:</p>
  
  <pre><code>&lt;profiles&gt;
    &lt;profile&gt;
      &lt;id&gt;dev&lt;/id&gt;
      &lt;activation&gt;
        &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
      &lt;/activation&gt;
      &lt;properties&gt;
        &lt;spring.profiles.active&gt;dev&lt;/spring.profiles.active&gt;
      &lt;/properties&gt;
      &lt;build&gt;
        &lt;finalName&gt;${project.artifactId}-dev-${project.version}&lt;/finalName&gt;
      &lt;/build&gt;
    &lt;/profile&gt;
    &lt;profile&gt;
      &lt;id&gt;test&lt;/id&gt;
      &lt;properties&gt;
        &lt;spring.profiles.active&gt;test&lt;/spring.profiles.active&gt;
      &lt;/properties&gt;
      &lt;build&gt;
        &lt;finalName&gt;${project.artifactId}-test-${project.version}&lt;/finalName&gt;
      &lt;/build&gt;
    &lt;/profile&gt;
    &lt;profile&gt;
      &lt;id&gt;prod&lt;/id&gt;
      &lt;properties&gt;
        &lt;spring.profiles.active&gt;prod&lt;/spring.profiles.active&gt;
      &lt;/properties&gt;
      &lt;build&gt;
        &lt;finalName&gt;${project.artifactId}-prod-${project.version}&lt;/finalName&gt;
      &lt;/build&gt;
    &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p>The standard test class is defined as:</p>
  
  <pre><code>@RunWith(SpringRunner.class)
  @SpringBootTest
  @ActiveProfiles("dev")
  public class DocumentComposerApplicationTests {
  
      @Test
      public void contextLoads() {
      }
  
  }
  </code></pre>
  
  <p>Now when I run the following maven command:</p>
  
  <p><code>mvn clean package -Ptest</code></p>
  
  <p>Then the following artifact is build:</p>
  
  <p><code>app-test-1.0.0.war</code></p>
  
  <p>But in the application.properties file there is the following:</p>
  
  <p><code>spring.profiles.active=dev</code></p>
  
  <p>So maven is correctly building the artifact with the profile "test" given on the command line.
  But the resource filtering is putting the value from the "dev" profile as spring.profiles.active in the application.properties file.</p>
  
  <p>So what am I doing wrong and how can I achieve a maven build where the spring.profiles.active will be correctly replaced in the application-properties with the "test" value specified in the test profile?</p>