Spring Boot + Eclipse : why application.properties is excluded in .classpath?

Viewed 6677

I created a basic SpringBoot 1.5.7 app from http://start.spring.io/ (Java, Maven), and I'm working with the Eclipse project created with mvn eclipse:eclipse.

I noticed that if I modify my application.properties file and afterwards run a Junit test (all from inside Eclipse), the new version is not used.

Digging a little, I found that the new application.properties file is not copied from src/main/resources/ to target/classes/ by the Eclipse build. And it seems that the cause is that it's marked as "excluded" in the Eclipse project settings. Indeed, my (automatically generated) .classpath file says:

<classpath>
  <classpathentry kind="src" path="src/test/java" output="target/test-classes" 
     including="**/*.java"/>
  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
  <classpathentry kind="src" path="src/main/resources" 
excluding="**/*.java|**/application*.yml|**/application*.yaml|**/application*.properties"/>
  ...

Of course, the file is actually copied when I run the Maven spring-boot:run target.

Why, then, is it excluded by Eclipse's classpath? Is this right?

2 Answers
Related