パッチを適用する必要がある依存関係がいくつかあります。現在、端末から次のことを行っています(ubuntuを実行しています)
patch -R -p1 <Myfolder/Tests/mypatch.patch
指定した作業ディレクトリから。これをMavenでのビルドの一部として実行したいと思います。私は試しました(ここでxmlで「<」を指定する方法に基づいて:XMLドキュメントでエスケープする必要がある文字は何ですか?):
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>apply-patch</id>
<phase>initialize</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>patch</executable>
<workingDirectory>../../wdir</workingDirectory>
<arguments>
<argument>R</argument>
<argument>p1</argument>
<argument><Myfolder/Tests/mypatch.patch</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
しかし、それは失敗します:
[INFO] --- exec-maven-plugin:1.2.1:exec (apply-patch) @ my-project ---
patch: '<Myfolder/Tests/mypatch.patch': extra operand
patch: Try `patch --help' for more information.
何か案は?
編集:代わりにオプション -i を試しました:
<execution>
<id>apply-patch</id>
<phase>initialize</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>patch</executable>
<workingDirectory>target/tmp</workingDirectory>
<arguments>
<argument>R</argument>
<argument>p1</argument>
<argument>i</argument>
<argument>mypatch.patch</argument>
</arguments>
</configuration>
</execution>
しかし、それはエラーを与えます:
[INFO] --- exec-maven-plugin:1.2.1:exec (apply-patch) @ my-project ---
patch: i: extra operand
patch: Try `patch --help' for more information.
ここでそれが可能であるようです:
だから私が見逃しているのはほんの些細なことだと思います。何かアイデアはありますか?