2011-05-18 94 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