Maven by default copies all the files in "src / main / resources" to the output folder, so in your current configuration it will probably create the folders "dev", "test" and "prod" with their contents, and then additionally copy the development resources without the prefix "dev".
I would suggest leaving the default resource folder as it is, and use it only for profile-independent resources. In your profile, you can configure additional resource folders:
<profile> <id>dev</id> <build> <resources> <resource> <directory>${basedir}/src/main/resources-dev</directory> </resource> </resources> </build> </profile>
It should also be possible to configure this in the general assembly section using the properties defined in the profiles:
<build> <resources> <resource> <directory>${basedir}/src/main/resources-${projectStage}</directory> </resource> </resources> </build> <profiles> <profile> <id>dev</id> <properties> <projectStage>dev</projectStage> </properties> </profile> </profiles>
If for some reason you cannot change your current directory structure, you will have to configure exclusions for the default resource folder so as not to copy the nested profile-dependent folders:
<build> <resources> <resource> <directory>${basedir}/src/main/resources</directory> <excludes> <exclude>dev/**</exclude> <exclude>test/**</exclude> <exclude>prod/**</exclude> </excludes> </resource> </resources> </build>
JΓΆrn horstmann
source share