Copy Build Definition error, help
my project copy utility has run into a problem. Apparently I don't copy something from a build definition..
we get this error
2014-01-30 08:24:05 [Jazz build engine]
com.ibm.team.build.common.TeamBuildException: Request for build "SME.Trunk.Build.UI.Nightly" does not include a configuration element for the BUILD phase. The Jazz build engine does not support a generic build definition with no builder.
I copied every element. and every property.. what did I miss? I do NOT 'initialize' the new builddef.
I do not know what template was originally selected
IBuildDefinition newbuildDef = BuildItemFactory.createBuildDefinition((IProcessArea) new_project);
for (IBuildConfigurationElement buildConfElem : (List<IBuildConfigurationElement>) oldbuildDef.getConfigurationElements())
{
IBuildConfigurationElement newconfElem = BuildItemFactory.createBuildConfigurationElement();
// then copy its properties
for (IConfigurationProperty buildConfigProperty : (List<IConfigurationProperty>) buildConfElem.getConfigurationProperties())
{
}
}
// then copy the build properties
for (IBuildProperty bdp : (List<IBuildProperty>) oldbuildDef.getProperties())
{
}
then save the thing
newbuildDef = buildClientdev.save(newbuildDef, null);
One answer
Hi Sam. The code above doesn't show the copied config elements or properties getting added to the new definition. Maybe that was just filtered out by the forum. You also need to set an id and owning process area on it (you must be doing so already, or it wouldn't save). Another option is to use IBuildDefinition.copyDefinition() and then replace the properties that differ, e.g. set the copied process area.
Comments
1 vote