Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keep permissions on files with Maven resources:testResources

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.

like image 834
Viktor Hedefalk Avatar asked Jun 29 '11 13:06

Viktor Hedefalk


1 Answers

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> 
like image 147
wjans Avatar answered Oct 12 '22 02:10

wjans