It's all about the answers!

Ask a question

Build Definition


Bill Trautman (314) | asked Jul 24 '15, 10:34 a.m.
edited Jul 24 '15, 11:23 a.m.
 Working with Ration Team Concert 5 environment and using the JazzBuildToolkit.  I am  finding that the properties in the build definition I am using are not being passed as property to ant build.   the build engine definitions are.  any thoughts on what may be the issue and how to correct it.

[edit}

What I have in place is

1)  a build engine definition (with properties specified on the definition)
2)  a build definition based on the ant template (with properties specified on the properties page) (there are two places that properties can be defined, one is the schedule page and one is the properties page.
3)  a JBE that advertises as the build engine definitions execution resource. 

I am running personal builds against my workspace using the build definition.  (I have tried submitting properties on the build request also)

if I look at the log produced I see that the properties from the build engine and the submission request appear as properties my ANT script sees.  I see no evidence that the build definition properties are present.

Snip from build log with -v -d specified for the ant command line:  (some edits with .... for withheld info or chatty output...)  bolded items are from the submission and the engine properties settings.

.....
Adding reference: ant.ComponentHelper
Setting ro project property: buildEngineHostName -> {cannot determine host name}
Setting ro project property: abcdefgh -> 12345678
Setting ro project property: com.ibm.team.build.internal.engine.monitoring.threshold -> 3
Setting ro project property: requestUUID -> _HOEUEDILEeWcW562sOfrfg
....
Setting ro project property: buildEngineId -> MyBuildEngine
Setting ro project property: personalBuild -> true
...
Setting ro project property: buildResultUUID -> _HOEUETILEeWcW562sOfrfg
Setting ro project property: buildLabel -> 20150724-0859
Setting ro project property: com.ibm.team.build.internal.template.id -> com.ibm.team.build.ant
Setting ro project property: team.scm.workspaceUUID -> _uT-zkCmPEeWvu7MCD8z2rA
Setting ro project property: team.scm.buildOnlyIfChanges -> true
Setting ro project property: myPassword -> ......
Setting ro project property: team.scm.acceptBeforeFetch -> true
Setting ro project property: team.scm.createFoldersForComponents -> false
Setting ro project property: team.scm.deleteDestinationBeforeFetch -> true
Setting ro project property: team.scm.includeComponents -> false
Setting ro project property: team.scm.loadComponents ->
...
Setting ro project property: ant.file.type -> file
Adding reference: ant.projectHelper
Adding reference: ant.parsing.context
Adding reference: ant.targets
...

Accepted answer


permanent link
Zeeshan Choudhry (6541612) | answered Jul 27 '15, 4:16 a.m.
Properties that you would like to be passed to the ANT Build.xml from RTC triggered build, should be defined in the Build Definition "Properties" TAB. 

For example: 

In Build definition I passed the properties to Ant Build.xml as 

Build Definition > Properties > Add > String > "Builduser" with value "zee" 
Build Definition > Properties > Add > String > "mypassword" with value "zee" 
Save Build definition. 

Now in Build.xml I use these properties as: 


    <target name="clean">
      <echo>Build User: </echo><echo message="${Builduser}"/>
      <echo>Password: </echo><echo message="${mypassword}"/>
      <startBuildActivity repositoryAddress="${repositoryAddress}"
             userId="${Builduser}" password="${mypassword}
             buildResultUUID="${buildResultUUID}"
             label="Delete Bin Folder"
             autoComplete="true"
             verbose="true" />
      <delete dir="bin"/>
    </target>


The verbose output showing values are passed correctly to the Ant Build. 

...
Setting ro project property: Builduser -> zee
Setting ro project property: mypassword -> zee
...
...


Target verbose output: 

clean:
     [echo] Build User: 
     [echo] zee
     [echo] Password: 
     [echo] zee
.....
.....
[startBuildActivity] Started build activity "Delete Bin Folder" for build result "20150727-0403".
   [delete] Deleting directory C:\Dummy\JBE_Build_Proj\bin


You should use the Build definition "Properties" TAB to define your properties that you are going to use in the ANT Build script ( XML) . 

Also for scheduled builds if you want to override some property then you define them here in Schedule tab under  "Schedule property overrides" . Otherwise regular Properties tab in the build definition will be used. 
Bill Trautman selected this answer as the correct answer

Comments
Bill Trautman commented Jul 27 '15, 7:51 a.m.

I will mark your answer as the accepted answer as it is (as far as I can tell) the exact right thing to do.   I have done this but still do not see the properties from the build definition property page.  Not quite sure what the issue is at this point.  seems like an RTC to JBE communication issue in that the build definition (vs build engine, etc) properties are just not being passed in.


Zeeshan Choudhry commented Jul 27 '15, 8:08 a.m.

Try deleting the build definition and creating a new one. 

If you still can not get it to work then open a jazz.net defect and post the link here. 
I have tested 4.0.6 and 5.0.2 so far. Maybe it needs a second look again replicating your environment so please add a complete use case as well to jazz.net defect with your environment details. ( OS+Software versions etc ) 

One other answer



permanent link
Zeeshan Choudhry (6541612) | answered Jul 24 '15, 10:58 a.m.
Can you be specific what properties are not being passed. 
I assume this is only JBE engine that is being used. 
How are you using the properties in your build xml which are defined in Build definition?

A tip: Use the same version of BuildToolKit as the server. 

Comments
Bill Trautman commented Jul 24 '15, 11:24 a.m.

did recently change the build tookit to what should be the server level.  both are 5.0.1 levels. (to the best of my knowledge).


Bill Trautman commented Jul 24 '15, 11:27 a.m.

regarding how they are being used.   the are being referenced  by name like this for example:
        <ftp action="mkdir" server="<removed>"
            userid="${myUserid}" password="${myPassword}"
            passive="true" remotedir="${buildOutputDirectory}" verbose="true" />

Your answer


Register or 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.