我有一些需要修补的依赖关系。目前,我从一个终端(运行Ubuntu的)将修补程序作为maven构建步骤的一部分
patch -R -p1 <Myfolder/Tests/mypatch.patch
从指定的工作目录。现在我想做这个作为我的maven构建的一部分。我曾尝试(基于如何 “<” 应该在一个xml这里指定:What characters do I need to escape in XML documents?):
<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.
这似乎是可能的:
所以我想它只是我想念的一个小细节,任何想法?
请参阅已编辑的帖子,我已尝试使用选项-i但 我犯了同样的错误。 – u123
@ u123尝试单个' imypatch.patch ',而不是将它们分隔为两个参数。 –
Dev