diff --git a/pom.xml b/pom.xml index 74609ce..48ca614 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ under the License. - 3.2.0 + 3.3.0-SNAPSHOT 3.1.0 7 2020-08-05T15:25:21Z @@ -79,6 +79,10 @@ under the License. Graham Leggett + + Imad BELMOUJAHID + BELMOUJAHID.I@Gmail.Com + diff --git a/src/main/java/org/apache/maven/plugins/resources/ResourcesMojo.java b/src/main/java/org/apache/maven/plugins/resources/ResourcesMojo.java index a350a44..b7ffdc3 100644 --- a/src/main/java/org/apache/maven/plugins/resources/ResourcesMojo.java +++ b/src/main/java/org/apache/maven/plugins/resources/ResourcesMojo.java @@ -50,7 +50,7 @@ /** * Copy resources for the main source code to the main output directory. Always uses the project.build.resources element * to specify the resources to copy. - * + * @author Michal Maczka * @author Jason van Zyl * @author Andreas Hoheneder @@ -208,6 +208,14 @@ public class ResourcesMojo @Parameter protected LinkedHashSet delimiters; + /** + * This parameter is used in particular for filters properties files with format json. + * if this parameter is not empty, we select all the parameters who are the nodes start with this parameter + * This helps us to add a ROOT node FOR EACH environment in a same JSON file + */ + @Parameter + protected String rootNode; + /** * Use default delimiters in addition to custom delimiters, if any. * @@ -349,6 +357,9 @@ public void execute() // Handle MRESOURCES-171 mavenResourcesExecution.setPropertiesEncoding( propertiesEncoding ); + // Set rootNode for new feature with json file ### MRESOURCES-284 ### + mavenResourcesExecution.setRootNode( rootNode ); + if ( nonFilteredFileExtensions != null ) { mavenResourcesExecution.setNonFilteredFileExtensions( nonFilteredFileExtensions ); diff --git a/src/test/java/org/apache/maven/plugins/resources/BasicPropertyUtilsTest.java b/src/test/java/org/apache/maven/plugins/resources/BasicPropertyUtilsTest.java index 35473b9..b27930b 100644 --- a/src/test/java/org/apache/maven/plugins/resources/BasicPropertyUtilsTest.java +++ b/src/test/java/org/apache/maven/plugins/resources/BasicPropertyUtilsTest.java @@ -24,6 +24,9 @@ import org.apache.maven.shared.filtering.PropertyUtils; +/** + * @author Imad BELMOUJAHID @ImadBL + */ public class PropertyUtilsExceptionTest { /** * load property test case can be adjusted by modifying the basic.properties and basic_validation properties + * I added a null for this parameter (rootNode) because it is only used with json file @ImadBL * * @throws Exception */ @@ -37,6 +41,6 @@ public class PropertyUtilsExceptionTest public void loadPropertyFileShouldFailWithFileNotFoundException() throws Exception { - PropertyUtils.loadPropertyFile( new File( "NON_EXISTENT_FILE" ), true, true ); + PropertyUtils.loadPropertyFile( new File( "NON_EXISTENT_FILE" ), true, true, null ); } }