【发布时间】:2016-08-09 02:36:10
【问题描述】:
这里是新的 Ant 用户。我创建了一个条件任务,它作为 Maven Ant 插件在内部运行。我面临的问题是条件目标:在构建过程中找不到“ui-test-condition”。
返回的错误是:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run (uitests) on project myProject: An Ant BuildException has occured: Target "ui-test-condition" does not exist in the project "maven-antrun-". It is used from target "ui-test-run". -> [Help 1]
这表明下面的代码中存在语法错误,但我无法确定问题所在。非常感谢任何帮助。
<target name="ui-test" depends="ui-test-run,ui-test-skip"/>
<target name="ui-test-condition">
<condition property="ui-test-condition-run">
<and>
<istrue value="${ui.test}"/>
</and>
</condition>
</target>
<target name="ui-test-run" depends="ui-test-condition" if="ui-test-condition-run">
<echo>Running tests</echo>
<exec dir="src/main/webapp/ui" executable="src/main/webapp/ui/${some.executable}"
resolveexecutable="true" failonerror="true">
<arg value="-e" />
<arg value="foo/run" />
</exec>
</target>
<target name="ui-test-skip" depends="ui-test-condition" unless="ui-test-condition-run">
<echo>Tests are skipped</echo>
</target>
【问题讨论】:
-
不一定是这个问题的答案,但我能够重构以上内容以匹配其他用户的查询:stackoverflow.com/questions/2324392/…