I am trying to write a Hudson plugin for Jazz SCM. I have followed the basic ANT build tutorials on the Jazz website but need to call the current ANT API from Java if I am to be able to write a usable plugin. I have managed to get the basic plugin skeleton code written for but when I request a build I get the following error:
started
FATAL: java.lang.NullPointerException
java.lang.NullPointerException
at com.ibm.team.build.ant.task.AbstractTeamBuildTask.execute(AbstractTeamBuildTask.java:432)
at org.jvnet.hudson.tools.JazzSCM.checkout(JazzSCM.java:130)
at hudson.model.AbstractProject.checkout(AbstractProject.java:529)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:223)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:189)
at hudson.model.Run.run(Run.java:646)
at hudson.model.Build.run(Build.java:102)
at hudson.model.ResourceController.execute(ResourceController.java:70)
at hudson.model.Executor.run(Executor.java:62)
Caused by: java.lang.NullPointerException
at com.ibm.team.build.ant.task.StartBuildTask.verifyTeamBuildListenerIsActive(StartBuildTask.java:197)
at com.ibm.team.build.ant.task.StartBuildTask.doExecute(StartBuildTask.java:178)
at com.ibm.team.build.ant.task.AbstractTeamBuildTask.execute(AbstractTeamBuildTask.java:419)
... 8 more
--- Nested Exception ---
java.lang.NullPointerException
at com.ibm.team.build.ant.task.StartBuildTask.verifyTeamBuildListenerIsActive(StartBuildTask.java:197)
at com.ibm.team.build.ant.task.StartBuildTask.doExecute(StartBuildTask.java:178)
at com.ibm.team.build.ant.task.AbstractTeamBuildTask.execute(AbstractTeamBuildTask.java:419)
at org.jvnet.hudson.tools.JazzSCM.checkout(JazzSCM.java:130)
at hudson.model.AbstractProject.checkout(AbstractProject.java:529)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:223)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:189)
at hudson.model.Run.run(Run.java:646)
at hudson.model.Build.run(Build.java:102)
at hudson.model.ResourceController.execute(ResourceController.java:70)
at hudson.model.Executor.run(Executor.java:62)
The code I have which gives this is as follows:
StartBuildTask myStartBuildTask = new StartBuildTask();
String label = (new Date().toString());
myStartBuildTask.setAutoComplete(false);
myStartBuildTask.setBuildDefinitionId(getBuildDefinitionId()); // Prelude Team build 2
myStartBuildTask.setLabel("Build-" + label);
myStartBuildTask.setResultUUIDProperty("buildResultUUID");
myStartBuildTask.setEngineId(getBuildEngineId()); // standalone
myStartBuildTask.setPassword(getPassword()); // build
myStartBuildTask.setRepositoryAddress(getRepositoryLocation()); // https://localhost:9443/jazz
myStartBuildTask.setUserId(getUsername()); // build
myStartBuildTask.execute();
My Jazz Server is running and I have my build set up in Jazz as follows:
ID: Prelude Team build 2
Team Area: Prelude Team
Supporting Build Engine: standalone (which is Active (idle), in the Prelude Team Area)
I have tried downloading the source code from Jazz.net, but I cannot find the code for
com.ibm.team.build.ant.task.StartBuildTask.verifyTeamBuildListenerIsActive
I've tried debugging too and looking at the documented API but there seems like there is nothing else I need to provide.
Can anyone point me in the direction of a solution for this problem?
TIA
Cheers, Andrew