2011-05-18 74 views
1

我使用巡航控制框架每晚构建。蚂蚁attrib问题

目前我试图设置一些文件夹为只读=“假”

2011-05-18 11:40:17,089 [Thread-23] WARN ScriptRunner  - C:\builds\nightly_build.xml:30: Problem: failed to create task or type attrib 
2011-05-18 11:40:17,089 [Thread-23] WARN ScriptRunner  - Cause: the class org.apache.tools.ant.taskdefs.optional.windows.Attrib was not found. 
2011-05-18 11:40:17,089 [Thread-23] WARN ScriptRunner  -   This looks like one of Ant's optional components. 
2011-05-18 11:40:17,105 [Thread-23] WARN ScriptRunner  - Action: Check that the appropriate optional JAR exists in 
2011-05-18 11:40:17,105 [Thread-23] WARN ScriptRunner  -   -C:\builds\lib 
2011-05-18 11:40:17,105 [Thread-23] WARN ScriptRunner  -   -C:\Documents and Settings\admin\.ant\lib 
2011-05-18 11:40:17,105 [Thread-23] WARN ScriptRunner  -   -a directory added on the command line with the -lib argument 
2011-05-18 11:40:17,105 [Thread-23] WARN ScriptRunner  - 
2011-05-18 11:40:17,105 [Thread-23] WARN ScriptRunner  - Do not panic, this is a common problem. 
2011-05-18 11:40:17,105 [Thread-23] WARN ScriptRunner  - The commonest cause is a missing JAR. 
2011-05-18 11:40:17,105 [Thread-23] WARN ScriptRunner  - 
2011-05-18 11:40:17,105 [Thread-23] WARN ScriptRunner  - This is not a bug; it is a configuration problem 

误差如上所示。

出现这种情况时,我使用<attrib>

<attrib readonly="false"> 
<dirset dir="C:/Work/6.70_Extensions/NightlyBuild" /> 
</attrib> 

我如何解决这个问题?以及如何找出我拥有的ANT版本?

回答

0

的ATTRIB任务来使用Ant 1.6 - 看Ant Manual
检查你的Ant版本与内建物业ant.version:

<echo>${ant.version}</echo> 
+0

嗨它说蚂蚁1.7.0,但为什么我不能'attrib'? – jeremychan 2011-05-18 06:39:21

+0

当使用巡航控制附带的ant版本时,如果您必须使用1.7.0版本,请使用最新的Ant版本1.8.2 替换Ant -diagnostics并获取您的ant安装的详细信息 – Rebse 2011-05-18 08:38:26

+0

@rebse我拥有非常奇怪的情况。当我做诊断时,我得到'“蚂蚁”不被识别为内部或外部命令' – jeremychan 2011-05-18 08:45:14

0

你有蚂蚁在nodeps.jar $ ANT_HOME/lib目录?这是包含Attrib类的jar,所以它需要放在你的Ant类路径上。

+0

如何找到ant_home? – jeremychan 2011-05-18 08:46:32

+0

在窗口上echo%ANT_HOME%,或者在cmd中调用'set'来查看所有的环境设置;但是当使用巡航控制自带的Ant版本时,%ANT_HOME%将是CruiseControll-InstallFolder/apache-ant-1.7.0 CruiseControl 2.8.3二进制版本包含所有的ant 1.7.0;当使用内建的ant版本时,应该包含ant-nodeps.jar! – Rebse 2011-05-18 08:54:36

+0

是的,我刚刚检查过'cruisecontrol/apache-ant-1.7.0'文件夹下的'lib'文件夹中有'ant-nodeps.jar' – jeremychan 2011-05-18 09:01:14