次の exec-maven-plugin 構成を使用してファイルのアクセス許可を付与しようとしています:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>grant-permissions</id>
<phase>validate</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>chmod</executable>
<arguments>
<argument>+x</argument>
<argument>${somePath}/*.sh</argument>
</arguments>
</configuration>
</execution>
印刷します
chmod: '...my_path.../*.sh' にアクセスできません: そのようなファイルまたはディレクトリはありません
でも交換したら
<argument>${somePath}/*.sh</argument>
by <argument>${somePath}/myfirst_script.sh</argument>
- すべて正常に動作します!
そのようなアプローチを使用する方法を明確にし、「*.sh」を使用して引数をより一般的にしてください。
編集:
依存関係をアンパックするために依存関係プラグインを使用するため、最初はこれが必要ですが、何らかの理由でファイルのアクセス許可が失われ、関連する JIRA のようです - https://jira.codehaus.org/browse/MDEP-109
パーミッションを戻す antrun のアプローチがあることは知っていますが、実際には見栄えが悪く、pom.xml で antrun プラグインを使用したくない...