How to stop Maven from overwriting resource files

Use the property -Dmaven.resources.overwrite=false on the Maven command. See the overwrite parameter of the resources:resources goal.

However the documentation mentions this is the default behavior so check if this parameter is set to true somewhere in your project configuration.

EDIT:

As mentioned in the comments, it seems that even though the log indicates copying, in fact the files are not being changed (the timestamps remain the same when maven.resources.overwrite is false).


Be aware:

The maven-resources-plugin ignores the overwrite flag if filtering resources is activated.