【发布时间】:2012-01-18 19:38:18
【问题描述】:
我的项目使用以下命令运行良好:
C:\project\<project_name>\ant -lib ant\lib -buildfile applications/<sub-project-path>/ant/build.xml deploy
但是,如果我将此命令包装在 maven-antrun-plugin 或 pom 中的 exec-maven-plugin 中,我会遇到各种路径问题。
对于 maven-antrun-plugin,由于路径问题,某些属性似乎无法加载。在 exec-maven-plugin 中,似乎 ant 目标从未正确传入。
有人可以建议我如何在 pom 文件中应用它吗?非常感谢。
这是我给 exec 的 pom:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>ant</executable>
<workingDirectory>${basedir}</workingDirectory>
<arguments>
<argument>'-lib ant/lib'</argument>
<argument>'-buildfile $basedir/<project-path>/build.xml'</argument>
<argument>deploy</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
【问题讨论】:
-
好的,我已经解决了这里的问题。显然在争论中,你不能通过空间。所以这个问题解决了。然而,我仍然很好奇如何在 antrun-plugin 中编写它。这是 pom 文件,它不知道如何解析路径。