Add Log To Build Result
![]()
Hi,
I'm wondering if it's possible to add a log file to the build result? We get the default log, "Full Build Log", but I'd like to add another that comes out of the build so that it's easily accessible. Is this possible if we aren't using Ant? Thanks, Lachlan Hillman. |
14 answers
![]() Hi, Hi, The Logs tab in the Eclipse UI has a button to add a log file and you already know of the Ant task. Another option is to use the Java API to code a program to add a log (which is essentially what the Ant task does). Brent Ulbricht RTC Build Lead |
![]() Hi, Hi, The Logs tab in the Eclipse UI has a button to add a log file and you already know of the Ant task. Another option is to use the Java API to code a program to add a log (which is essentially what the Ant task does). Brent Ulbricht RTC Build Lead Hi, Thanks for the response. I need to do this programatically (thus the "Add File" button in the RTC UI isn't a viable option). In terms of replicating the Ant Task, is there any API documentation I could refer to? Is there even an exposed API? Do you have any advice regarding how I could go about this? Thanks, Lachlan Hillman. |
![]() Hi, Hi, The Logs tab in the Eclipse UI has a button to add a log file and you already know of the Ant task. Another option is to use the Java API to code a program to add a log (which is essentially what the Ant task does). Brent Ulbricht RTC Build Lead Hi, Thanks for the response. I need to do this programatically (thus the "Add File" button in the RTC UI isn't a viable option). In terms of replicating the Ant Task, is there any API documentation I could refer to? Is there even an exposed API? Do you have any advice regarding how I could go about this? Thanks, Lachlan Hillman. Hi, You'll need to check out the com.ibm.team.build.client.ITeamBuildClient addBuildResultContribution method. There are some Build code examples (but not for how to add a log) at https://jazz.net/wiki/bin/view/Main/BuildJavaProgrammingExamples . Brent Ulbricht RTC Build Lead |
![]()
I suggest checking out the source for:
com.ibm.team.build.ant.task.LogPublisherTask which delegates to: com.ibm.team.build.internal.publishing.LogPublisher which extends: com.ibm.team.build.internal.publishing.ContentPublisher -> com.ibm.team.build.internal.publishing.AbstractFilePublisher -> com.ibm.team.build.internal.publishing.AbstractContributionPublisher The essence of it is in com.ibm.team.build.internal.publishing.AbstractContributionPublisher.publish(IBuildResultHandle, BuildStatus, ITeamRepository) which does:
The contribution type id to use is com.ibm.team.build.common.model.IBuildResultContribution.LOG_EXTENDED_CONTRIBUTION_ID initializeContribution comes from AbstractFilePublisher:
and getFileContent (which creates the IContent blob from the file) is in ContentPublisher:
|
![]()
Thanks very much for the help, guys.
Trying to take step #1, and stumbling already! For some reason I'm getting a NullPointerException when running the QueryBuildsWithTagExample from https://jazz.net/wiki/bin/view/Main/BuildJavaProgrammingExamples Here's the stack trace:
The repository URL, username and password are 100% certainly valid (copy-pasted directly out of a working RTC client), and the RTC host is definitely accessible from this machine (I regularly check out source using the Jazz SCM tools). If you guys have any ideas, please let me know. P.S. The RTC server is version 3, and I have version 3 of the SDK. |
![]()
Not sure about that particular NPE. I've not seen it before. First thing to check is that you're not using an old JDK/JRE. I suggest using the one we ship with the RTC client (or server).
See https://jazz.net/wiki/bin/view/Main/BuildFAQ#WhichJDK |
![]() Not sure about that particular NPE. I've not seen it before. First thing to check is that you're not using an old JDK/JRE. I suggest using the one we ship with the RTC client (or server). Thanks for the response. This is what I've been doing. I've been pointing to the jdk that comes with the JBE (which has been used to access the same RTC server). For reference, this version is: IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Linux x86-32) The fact that it's failing on some sort of certificate related function tells me that it may be a configuration problem on my local machine. I'm just not sure what. Is there any way to view the source code for the class in question? (com.ibm.team.repository.transport.client.ValidatingX509TrustManager) |
![]()
Found a similar workitem here:
97073: NPE when running API snippet code from server. Are you developing against 2.x, 3.0 or 3.0.1? For source code, check the bottom of the 'all downloads' tab for the release, e.g. https://jazz.net/downloads/rational-team-concert/releases/3.0.1?p=allDownloads That work item talks about having an incorrect library setup. No further details, unfortunately, but you could follow up in there. If you're not doing so already, I suggest following the setup instructions in the SDK doc: https://jazz.net/wiki/bin/view/Main/RtcSdk30 |
![]() Found a similar workitem here: Our RTC server is version 3. I've tried the following SDK versions: 2.0.0.1 2.0.0.2iFix6 3.0 3.0iFix1 3.0.1 Exact same error for all of them. Anybody have any more ideas? |
![]() Found a similar workitem here: Our RTC server is version 3. I've tried the following SDK versions: 2.0.0.1 2.0.0.2iFix6 3.0 3.0iFix1 3.0.1 Exact same error for all of them. Anybody have any more ideas? This old post in the 'Extending Team Concert' displays the same exception. You might try asking if they ever solved the issue. Brent Ulbricht RTC Build Lead |
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.