Build Definition
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
...
[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
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.
Comments
One other answer
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.