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 be able to use from my tests. My -rwxr-xr-x
is however changed to -rw-r--r--
in target/test-classes.
This seems to be a bug in the Maven Resource Plugin
If you are using the Maven Assembly Plugin, you can configure the file permissions there.
If not, you might consider a workaround. You could do this via Ant by doing something like this:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.6</version> <executions> <execution> <id>process-test-classes</id> <phase>process-test-classes</phase> <configuration> <target> <chmod file="target/test-classes/test.sh" perm="755"/> </target> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With