{
PrepareBuildProjectsTask prepareBuildTask = (PrepareBuildProjectsTask) task;
try
{
SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
log.info( "initializing buildContext for projectGroupId=" + prepareBuildTask.getProjectGroupId() );
List<Map<String, Object>> buildContext =
initializeBuildContext( prepareBuildTask.getProjectsBuildDefinitionsMap(),
prepareBuildTask.getBuildTrigger(), prepareBuildTask.getScmRootAddress(),
prepareBuildTask.getProjectScmRootId() );
startTime = System.currentTimeMillis();
client.buildProjects( buildContext );
endTime = System.currentTimeMillis();
}
catch ( MalformedURLException e )
{
log.error( "Invalid URL " + buildAgentUrl + ", not building" );