1
这里是新的Ant用户。我创建了一个条件任务,它作为Maven Ant插件运行。我面临的问题是条件目标:在构建期间未找到“ui-test-condition”。如何用Maven-Ant正确设置条件任务?
返回的错误是:
[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>
不一定是这个问题的答案,但我能够重构上述以匹配另一个用户的查询:http://stackoverflow.com/questions/2324392/run-a-ant-task-in-maven-only - 如果-A-财产被设定 –