如何通过蚂蚁向Jenkins传递以“ - ”开头的代码命令?

时间:2016-04-15 17:22:20

标签: xml jenkins ant codeception

构建我的第一个ant build.xml文件让Jenkins运行Codeception测试,我收到错误"--" is not permitted within comments

我知道从stackoverflow上的其他地方读取xml不允许这样做。 Cure for 'The string "--" is not permitted within comments.' exception?

难题是几个Codeception命令以 - : - xml, - html, - env等开头。

 <target name="View" description="test for single aaView page">
        <exec executable="${codecept}" failonerror="true">
            <arg value="run" />
            <arg value="tests/acceptance/aaViewCept.php" />
            <arg value="--xml" />
            <arg value="${basedir}/browser/${browser}/tests/_output/report.xml "/>
            <arg value="--env" />
            <arg value="${browser}" />
        </exec>
    </target>

踢球者是如果我删除failonerror="true"詹金斯运行测试就好了。我正在尝试将它放入,因为如果我不这样做,Jenkins会显示失败测试的传递构建。

1 个答案:

答案 0 :(得分:0)

部分=--"不是有效的XML。

使用<arg value="--xml"/><arg value="--env" />

arg元素的value属性定义传递给可执行文件的参数,--是这些参数的一部分。

但是如果你在<target>元素周围放置XML注释,XML解析器确实会抱怨,因为现在评论中不允许--