Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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);

0 votes



One answer

Permanent link
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.

0 votes

Comments

thanks.. I didn't include all the code.. I see now copyDefinition().. but

I am concerned that there are internal data items (handles) that don't map between different servers..  I have to remap the workspace and component UUIDs already..

I don't want 'anything' different.. except for the UUID based properties...

Things you need to map include:

- definition id (if there could be a conflict with an existing one)
- owning process area
- SCM workspace UUID (if definition uses Jazz SCM)
  - stored as a regular build property (not a config element property), with prop name available as constant:
com.ibm.team.build.internal.common.builddefinition.IJazzScmConfigurationElement.PROPERTY_WORKSPACE_UUID
- supporting build engines (actually stored the other way around: build engine has list of supported definitions)

There may be more, depending on the type of build.

Are you copying builds themselves too, or just the definitions/engines?  Builds and their contributions can have lots of refs to other items.

1 vote

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 562
× 235

Question asked: Jan 30 '14, 4:06 p.m.

Question was seen: 6,122 times

Last updated: Jan 31 '14, 12:35 p.m.

Confirmation Cancel Confirm