my project structure looks like this
-src/main/java
-src/main/resources
-dev
-app.properties
-prod
-app.properties
-sandbox
-app.properties
and I defined a maven profiles like this
<profiles>
<profile>
<id>dev</id>
<properties>
<build.profile>dev</build.profile>
</properties>
<build>
<resources>
<resource>
<directory>src/main/resources/dev</directory>
</resource>
</resources>
</build>
</profile>
<profile>
<id>prod</id>
<properties>
<build.profile>prod</build.profile>
</properties>
<build>
<resources>
<resource>
<directory>src/main/resources/prod</directory>
</resource>
</resources>
</build>
</profile>
<profile>
<id>sandbox</id>
<properties>
<build.profile>sandbox</build.profile>
</properties>
<build>
<resources>
<resource>
<directory>src/main/resources/sandbox</directory>
</resource>
</resources>
</build>
</profile>
</profiles>
what I am trying to do is to copy the right property from the right sub folder, when I triggered the right profile, e.g mvn -pdev install. will let the maven copy the app.properties file from the src/main/resource/dev folder then place into the jar I am building
my jar looks like this:
+dev
+prod
+sandbox
+META-INF
+com
-app.properties
the problem is 5 folders with a single properties file, I don't want the dev prod sandbox folders.