CruiseControl和NANT构建

时间:2013-01-16 22:26:00

标签: c# cruisecontrol.net nant

我正在测试一个非常简单的脚本来尝试从CruiseControl.NET运行我的ant构建文件。我按照我在网上找到的步骤如何执行此操作,但我一直在CruiseControl中无法解释nAnt任务失败,但是当我单独运行NAnt构建脚本时,它运行良好。

任何人都可以查看我的构建脚本,Ccnet.config文件和日志中的输出,并指出我正确的方向吗?

我的XmLib.build NAnt文件

<?xml version="1.0"?>
<project default="start">
    <property name="code.directory" value="C:\SHS" />
    <property name="server.code.directory" value="${code.directory}\XmLib" />
    <property name="server.code.project" value="${server.code.directory}\XmLib.sln" />

     <target name="start">
          <echo message="Building XmLib Component " />
     </target>
</project>

我通过命令行使用Nant.exe运行构建文件时的输出。

Buildfile: file:///C:/SHS/Build Scripts/XmLib.build
Target framework: Microsoft .NET Framework 4.0
Target(s) specified: start 


 start:

 [echo] Building XmLib Component 

 BUILD SUCCEEDED

 Total time: 0.4 seconds.

我的CruiseControl.NET配置文件

<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<project name="XmLib">
  <tasks>
    <nant>
      <executable>C:\Program Files (x86)\NAnt\bin\nant.exe</executable>
      <baseDirectory>C:\SHS\Build Scripts</baseDirectory>
      <buildFile>XmLib.build</buildFile>
      <logger>NAnt.Core.XmlLogger</logger>
      <targetList>
        <target>start</target>
      </targetList>
      <buildTimeoutSeconds>80</buildTimeoutSeconds>
    </nant>
  </tasks>
  <publishers>
      <xmllogger logDir="C:\tmp" />
  </publishers>
</project>
</cruisecontrol>

当我尝试使用其仪表板通过CruiseControl.NET运行时出现的错误。

  <cruisecontrol project="XmLib">
  <request source="BUILDHPSMV" buildCondition="ForceBuild">Administrator triggered a build        (ForceBuild) from BUILDHPSMV</request>
  <parameters>
  <parameter name="$CCNetArtifactDirectory" value="C:\Program Files (x86)\CruiseControl.NET\server\XmLib\Artifacts" />
  <parameter name="$CCNetBuildCondition" value="ForceBuild" />
  <parameter name="$CCNetBuildDate" value="2013-01-16" />
  <parameter name="$CCNetBuildId" value="a7fb196a3193468e8d8505f7db7641d5" />
  <parameter name="$CCNetBuildTime" value="17:06:44" />
  <parameter name="$CCNetFailureTasks" value="System.Collections.ArrayList" />
  <parameter name="$CCNetFailureUsers" value="System.Collections.ArrayList" />
  <parameter name="$CCNetIntegrationStatus" value="Unknown" />
  <parameter name="$CCNetLabel" value="1" />
  <parameter name="$CCNetLastIntegrationStatus" value="Failure" />
  <parameter name="$CCNetListenerFile" value="C:\Program Files(x86)\CruiseControl.NET\server\XmLib\Artifacts\XmLib_ListenFile.xml" />
  <parameter name="$CCNetModifyingUsers" value="System.Collections.ArrayList" />
  <parameter name="$CCNetNumericLabel" value="1" />
  <parameter name="$CCNetProject" value="XmLib" />
  <parameter name="$CCNetProjectUrl" value="http://BUILDHPSMV/ccnet" />
  <parameter name="$CCNetRequestSource" value="BUILDHPSMV" />
  <parameter name="$CCNetUser" value="Administrator" />
  <parameter name="$CCNetWorkingDirectory" value="C:\Program Files(x86)\CruiseControl.NET\server\XmLib\WorkingDirectory" />
  </parameters>
  <modifications />
  <integrationProperties>
  <CCNetArtifactDirectory>C:\Program Files(x86)\CruiseControl.NET\server\XmLib\Artifacts</CCNetArtifactDirectory>
  <CCNetBuildCondition>ForceBuild</CCNetBuildCondition>
  <CCNetBuildDate>2013-01-16</CCNetBuildDate>
  <CCNetBuildTime>17:06:44</CCNetBuildTime>
  <CCNetFailureUsers />
  <CCNetFailureTasks>
    <task>NAntTask</task>
  </CCNetFailureTasks>
  <CCNetIntegrationStatus>Failure</CCNetIntegrationStatus>
  <CCNetLabel>1</CCNetLabel>
  <CCNetLastIntegrationStatus>Failure</CCNetLastIntegrationStatus>
  <CCNetListenerFile>C:\Program Files(x86)\CruiseControl.NET\server\XmLib\Artifacts\XmLib_ListenFile.xml</CCNetListenerFile>
  <CCNetModifyingUsers />
  <CCNetNumericLabel>1</CCNetNumericLabel>
  <CCNetProject>XmLib</CCNetProject>
  <CCNetProjectUrl>http://BUILDHPSMV/ccnet</CCNetProjectUrl>
  <CCNetRequestSource>BUILDHPSMV</CCNetRequestSource>
  <CCNetWorkingDirectory>C:\Program Files(x86)\CruiseControl.NET\server\XmLib\WorkingDirectory</CCNetWorkingDirectory>
  <CCNetUser>Administrator</CCNetUser>
  <CCNetBuildId>a7fb196a3193468e8d8505f7db7641d5</CCNetBuildId>
  <LastIntegrationStatus>Failure</LastIntegrationStatus>
  <LastSuccessfulIntegrationLabel>UNKNOWN</LastSuccessfulIntegrationLabel>
  <LastModificationDate>1/15/2013 5:06:44 PM</LastModificationDate>
  </integrationProperties>
  <build date="2013-01-16 17:06:44" buildtime="00:00:00" error="true"buildcondition="ForceBuild"></build>
  </cruisecontrol>

1 个答案:

答案 0 :(得分:0)

只是一个猜测,但我怀疑未引用的路径是导致失败的原因。请尝试"C:\Program Files (x86)\NAnt\bin\nant.exe" resp。 "C:\SHS\Build Scripts"