Is it possible to keep permissions on file with Maven resources:testResources? My use case is a Selenium binary driver that I put in /src/test/resources that I would like to
I added a profile that gets activated automatically when run on a Unix machine. It executes an in-line shell script to adopt file permissions from all files in a folder recursively to files of the same name in another folder (see SRC and DST variables). The script requires a /bin/sh
as well as find
, xargs
and chmod
, which should exist on all modern systems.
unix
unix
org.codehaus.mojo
exec-maven-plugin
fix-resource-permissions
exec
process-test-resources
/bin/sh
-c
set -x
SRC="${basedir}/src/test/resources"
DST="${project.build.directory}/test-classes"
find "$$SRC" -printf "%P\0" | xargs --verbose -0 -I {} chmod --reference="$$SRC/{}" -f "$$DST/{}"