gpt4 book ai didi

maven - 保留对 Maven 资源文件的权限 :testResources

转载 作者:行者123 更新时间:2023-12-03 10:14:35 25 4
gpt4 key购买 nike

是否可以使用 Maven resources:testResources 保留文件权限?我的用例是一个 Selenium 二进制驱动程序,我把它放在/src/test/resources 中,我希望能够在我的测试中使用它。我的 -rwxr-xr-x然而改为-rw-r--r--在目标/测试类中。

最佳答案

这似乎是一个 bug in the Maven Resource Plugin

如果您使用的是 Maven 程序集插件,则可以配置 file permissions那里。

如果没有,您可以考虑一种解决方法。您可以通过 Ant 执行以下操作:

<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>

关于maven - 保留对 Maven 资源文件的权限 :testResources,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6521132/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com