[ https://issues.apache.org/jira/browse/MRESOURCES-284?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17528427#comment-17528427 ]
Imad BELMOUJAHID commented on MRESOURCES-284: --------------------------------------------- [~michael-o] grouping multiple properties files into a single json file. 1 file json for all environments. Json files are easier to manage and maintain compared to classic properties files. when you update a settings file, there is less chance to forget something but if you modify several files, you may forget or come up with an error This happened to me personally on one of my current projects > Support JSON format for parameter filter files > ---------------------------------------------- > > Key: MRESOURCES-284 > URL: https://issues.apache.org/jira/browse/MRESOURCES-284 > Project: Maven Resources Plugin > Issue Type: New Feature > Components: filtering > Affects Versions: 3.2.0 > Reporter: Imad BELMOUJAHID > Priority: Major > Labels: features, pull-request-available > Original Estimate: 96h > Remaining Estimate: 96h > > I wanted to trace a new evolution that I added recently. This concerns the > maven-resources-plugin (3.2.1-SNAPSHOT) and maven-filtering (3.3.0-SNAPSHOT) > plugins. > with this evolution it is now possible to add configuration files with json > format. the second part of the evolution is to have to use a single > configuration json file for all environments (dev, preprod, prod) > Example of use: > > {code:java} > <plugins> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-resources-plugin</artifactId> > <version>${maven-resources-plugin.version}</version> > <executions> > <execution> > <phase>compile</phase> > <goals> > <goal>resources</goal> > </goals> > <configuration> > <rootNode>dev</rootNode> > <!--suppress UnresolvedMavenProperty --> > <delimiters>@_*_@</delimiters> > <filters> > > <filter>${project.basedir}/src/main/properties/test.json</filter> > </filters> > <resources> > <resource> > <directory>src/main/resources</directory> > <filtering>true</filtering> > </resource> > </resources> > </configuration> > </execution> > </executions> > </plugin> {code} > <rootNode>dev</rootNode> : four determine the environment if the json file > contains multiple environments. if you want to use multiple files json (one > for each environment), you can remove this parameter and add the full path > from the root node in the ressource file (application.yml). > Example test.json: > > {code:java} > { > "dev" : { > "type" : "toto", > "key2" : "value2", > "key3" : { > "key4" : "value4" > } > }, > "qualif" : { > "type2" : "toto1", > "key5" : "value7", > "key7" : { > "key8" : "value7" > } > } > } {code} > Example ressource file: application.yml > {code:java} > spring: > profiles: @_key3.key4_@ > toto: @_type_@ > tata: @_key2_@ {code} > Example result: > {code:java} > spring: > profiles: value4 > toto: toto > tata: value2 {code} > I will send the PR > thanks -- This message was sent by Atlassian Jira (v8.20.7#820007)