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

How to programitcally publish a file to buildResults via java (equivalent to Ant task FilePulisher)?

Currently my build.xml uses the FilePublisher Ant Task to publish a file to the BuildResult. This works fine.
What I rather do though is to be able to publish the file to the buildResult via my Java class the build.xml triggers.
Within my Java class I have the repository address and the buildResultUUID, so I should be able to publish the file.
I have looked at the SDK BuildRequest, BuildResult, BuildResultContribution, etc and can't see how to do what I want to do although I think it should be able to be done.
Can someone direct me to the correct classes and methods I need to use to accomplish this? Any existing examples?

0 votes


Accepted answer

Permanent link
Hi Steve, the relevant API is ITeamBuildClient.addBuildResultContribution, where the contribution has contribution type id given by the value of IBuildResultContribution.ARTIFACT_EXTENDED_CONTRIBUTION_ID, and with its extendedContributionData set to the IContent the stored content blob, where IContentManager can be used to store the blob beforehand (see ITeamRepository.contentManager()). To see how this is done in more detail, check the source for ArtifactFilePublisher in the com.ibm.team.build.toolkit plugin.
Steve White selected this answer as the correct answer

0 votes

Comments

Nick, I got it working. Thanks once more for the excellent guidance.

Good to hear. Thanks for letting me know. 

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
× 10,938
× 562

Question asked: Jan 16 '15, 1:59 p.m.

Question was seen: 3,953 times

Last updated: Mar 30 '15, 2:01 p.m.

Confirmation Cancel Confirm