How to copy/move/delete files before tests and/or change file permissions for Linux OS with maven? I'm using maven-antrun-plugin for this purpose.
<plugin><artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<!-- backup file -->
<copy file="src/main/resources/db_conf.properties" tofile="src/main/resources/db_conf_prod.properties" />
<delete file="src/main/resources/db_conf.properties" />
<copy file="src/test/resources/db_conf.properties" tofile="src/main/resources/db_conf.properties" />
<copy file="src/main/resources/db_conf.properties" tofile="src/main/resources/db_conf_prod.properties" />
<delete file="src/main/resources/db_conf.properties" />
<copy file="src/test/resources/db_conf.properties" tofile="src/main/resources/db_conf.properties" />
<!-- set 755 parmissions -->
<chmod file=" src/main/resources/db_conf.properties " perm="755" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<chmod file=" src/main/resources/db_conf.properties " perm="755" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
0 коментарі:
Дописати коментар