【发布时间】:2012-01-31 04:15:52
【问题描述】:
我通过使用 Nant 作为构建来使用团队城市来构建我的项目。所以我创建了一个批处理文件来构建我的项目,我使用 Nant.exe 负责构建我的解决方案。
当我从命令提示符运行此批处理文件时,我能够成功构建我的解决方案。但是当我从 TeamCity 运行相同的文件时,它给了我构建失败错误。
所以我已经验证了路径并且这也是正确的。下面是我在队城里保存的路径。
- 构建文件的路径:Build.bat(用于构建的 bat 文件)
- 直接工作:D:\CMS(我的 bat 文件所在的路径。
- NAnt home:路径是 Nant exe 所在的位置。
- 目标框架:Net 4.0
当我每次构建失败并生成以下日志时,我都会按团队城市破坏此构建。
[21:27:54]: Checking for changes
[21:27:55]: Clearing temporary directory: C:\TeamCity\buildAgent\temp\buildTmp
[21:27:55]: Checkout directory: D:\Projects\JoyaCMS\src
[21:27:56]: Repository sources transferred
[21:27:55]: Updating sources: server side checkout... (1s)
[21:27:57]: Publishing internal artifacts (2s)
[21:27:57]: Starting: D:\Projects\JoyaCMS\src\UppercuT\lib\NAnt\NAnt.exe - buildfile:D:\Projects\JoyaCMS\src\build.bat -targetframework:net-4.0 - extension:C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NAntLoggers .dll -listener:JetBrains.BuildServer.NAntLoggers.NAntListener
[21:27:57]: in directory: D:\Projects\JoyaCMS\src
[21:27:57]: Process exited with code 1
[21:27:57]: NAnt output:
[21:27:57]: NAnt 0.91 (Build 0.91.3881.0; alpha2; 8/17/2010)
[21:27:57]: Copyright (C) 2001-2010 Gerry Shaw
[21:27:57]: http://nant.sourceforge.net
[21:27:57]: BUILD FAILED
[21:27:57]: For more information regarding the cause of the build failure, run the build again in debug mode.
[21:27:57]: Try 'nant -help' for more information
[21:27:57]: D:\Projects\JoyaCMS\src\build.bat(1,1):
[21:27:57]: Error loading buildfile.
[21:27:57]: Data at the root level is invalid. Line 1, position 1.
[21:28:02]: Publishing internal artifacts (1s)
[21:28:05]: Build finished
所以让我知道如何在团队城市中解决这个问题。以及我需要执行哪些设置才能解决此问题。
谢谢, 阿米特
【问题讨论】: