Posted on 2012-09-10 15:34
沙漠中的鱼 阅读(576)
评论(0) 编辑 收藏 所属分类:
其他
在编写ant脚本测试从cvs服务器上签出文件,但是发现报异常:
BUILD FAILED
D:\WorkSpace\Test\AntTest\src\cvs_build.xml:17: cvs exited with error code 1
Command line was [Executing 'cvs' with arguments:
'-d:pserver:zhanghui@192.168.1.107:/flystone'
'checkout'
The ' characters around the executable and arguments are
not part of the command.通过检查发现,原来是在ant脚本中,没有添加导出package包路径,添加上问题就解决好了,完整的ant配置文件如下:
<?xml version="1.0" encoding="utf-8"?>
<project default="checkout">
<property name="basedir" value="E:/tmp/" />
<property name="cvsroot" value=":pserver:test@192.168.1.107:/flystone" />
<property name="cvs.password" value="test" />
<property name="cvs.passfile" value="${basedir}/ant.cvspass" />
<target name="init">
<tstamp>
<format property="today" pattern="yyyy-MM-dd hh:mm:ss"/>
</tstamp>
<echo message="${today}" />
</target>
<target name="initpass" depends="init">
<cvspass cvsroot="${cvsroot}" password="${cvs.password}" passfile="${cvs.passfile}"/>
</target>
<target name="checkout" depends="initpass">
<cvs cvsroot="${cvsroot}" dest="${basedir}" cvsRoot="${cvsroot}" package="test/product" command="checkout" passfile="${cvs.passfile}" failonerror="true" error="error.log"/>
</target>
</project>