java - How to configure Maven profiles with different resources folders? -
i'm trying configure application have 2 build profiles: development , production. in order that, created 2 subdirectories under src/main/resources folder: src/main/resources/development , src/main/resources/production. each subdirectory has own .properties files.
<profiles> <profile> <id>development</id> <build> <resources> <resource> <directory>src/main/resources/development</directory> </resource> </resources> </build> </profile> <profile> <id>production</id> <build> <resources> <resource> <directory>src/main/resource/production</directory> </resource> </resources> </build> </profile> </profiles>
i build app command mvn install -p ${profile_here}
maven copies content of folder related chosen profile web-inf/classes output directory, development , production folders copied well.
web-inf/classes
web-inf/classes/development
web-inf/classes/production
how can solve problem?
thanks in advance.
the maven-war-plugin rather limited when comes resources. however, use maven-resources-plugin include/exclude resources described here: https://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html
Comments
Post a Comment