【发布时间】:2015-02-11 01:48:21
【问题描述】:
在这里,如果本地文件夹中不存在文件,我正在尝试从 git 中提取文件,这是我的代码。
<?xml version="1.0" encoding="utf-8"?>
<project name="MyProject" default="deploy">
<target name="deploy" depends="file-checks, local-file, git-file"/>
<target name="file-checks">
<available file="C:\Users\Hareesh\Desktop\H2H\conf\rdbms1.properties" property="file.found"/>
</target>
<target name="local-file" if="file.found">
<echo message="File is available in Local" />
</target>
<target name="git-file" unless="file.found">
<echo message="No" />
<git command = "clone">
<args>
<arg value = "git://github.com/280north/ojunit.git" />
<arg value = "ojunit" />
</args>
</git>
</target>
</project>
它显示以下错误:
Buildfile: C:\Users\Hareesh\Desktop\H2H\conf\build.xml
file-checks:
local-file:
git-file:
[echo] No
BUILD FAILED
C:\Users\Hareesh\Desktop\H2H\conf\build.xml:15: Problem: failed to create task or type git
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
Total time: 203 milliseconds
我关注了以下网址: http://tlrobinson.net/blog/2008/11/ant-tasks-for-git/
arg 值有什么错误吗?无法找到,因为我不了解 git 命令...请帮助我..提前致谢。
【问题讨论】: