It's all about the answers!

Ask a question

Building with Jazz Team Build


adi hasan (86174) | asked Mar 21 '11, 8:52 a.m.
Hai, Friends

i need your help..

i want to build the java application using RTC. I have successfully built the application but i don't find the feature/tab to download the result of build (.jar or .war).

the standard tabs that i got are Overview, Activities, and Log.


i read the article from IBM telling that that is the standard result for building and the additional tabs can be added depending on what build script contributes to the build result. I used the standard standard build.xml, i generated it with:
1. In the Package Explorer view, right-click a project; then click Export.
2. In the Export wizard, on the Select page, under General, select Ant Buildfiles and click Next.
3. On the Export page, ensure that your project and all check boxes are selected and click Finish.

the additional tabs that i see in the example are Overview, Activities, Log, compilation, tests, download, and properties.


and my question is how can I generate the build result with the download tab or any additional tab?

Please help me.. Thank you very much

6 answers



permanent link
Brent Ulbricht (2.5k11) | answered Mar 21 '11, 9:26 a.m.
JAZZ DEVELOPER
Hai, Friends

i need your help..

i want to build the java application using RTC. I have successfully built the application but i don't find the feature/tab to download the result of build (.jar or .war).

the standard tabs that i got are Overview, Activities, and Log.


i read the article from IBM telling that that is the standard result for building and the additional tabs can be added depending on what build script contributes to the build result. I used the standard standard build.xml, i generated it with:
1. In the Package Explorer view, right-click a project; then click Export.
2. In the Export wizard, on the Select page, under General, select Ant Buildfiles and click Next.
3. On the Export page, ensure that your project and all check boxes are selected and click Finish.

the additional tabs that i see in the example are Overview, Activities, Log, compilation, tests, download, and properties.


and my question is how can I generate the build result with the download tab or any additional tab?

Please help me.. Thank you very much


Hi,

It seems like you want to use the Ant build toolkit task artifactFilePublisher to publish your .jar/.war on the Downloads page of the build result.

The documentation at http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0/index.jsp (search on artifactFilePublisher) has more information, but the snippet below contains what this statement would look like in your Ant build file.


<artifactFilePublisher repositoryAddress="${repositoryAddress}"
userId="${userId}"
password="${password}"
buildResultUUID="${buildResultUUID}"
filePath="download.zip"
label="a download" />


Brent Ulbricht
Developer/Lead - RTC Build

permanent link
adi hasan (86174) | answered Mar 21 '11, 9:52 a.m.
Hi Brent,

thank you before for your advise.

i have added your code to my build.xml but i don't find the result that i want. nothing change. Sorry i am the new people in RTC so i really need help.

here is my build.xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. -->
<project basedir="." default="build" name="prelude project">
<property environment="env"/>
<property name="ECLIPSE_HOME" value="../../../../../Program Files/IBM/TeamConcert"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.5"/>
<property name="source" value="1.5"/>
<path id="prelude project.classpath">
<pathelement location="bin"/>
</path>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
<src path="src"/>
<classpath refid="prelude project.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
<target name="HelloWorld">
<java classname="paket1.HelloWorld" failonerror="true" fork="yes">
<classpath refid="prelude project.classpath"/>
</java>
</target>

<artifactFilePublisher repositoryAddress="${repositoryAddress}"
userId="${userId}"
password="${password}"
buildResultUUID="${buildResultUUID}"
filePath="download.zip"
label="a download" />

<buildResultPublisher repositoryAddress="${repositoryAddress}"
userId="${userId}"
password="${password}"
buildResultUUID="${buildResultUUID}"
label="new build label" />
</project>





and this is my command for JBE

jbe -repository https://localhost:9443/ccm -userId adi -pass adi -engineId PreludeBuildEngine2



thank you

permanent link
Anthony Kesterton (7.5k9180136) | answered Mar 21 '11, 1:18 p.m.
JAZZ DEVELOPER
Hi Brent,

thank you before for your advise.

i have added your code to my build.xml but i don't find the result that i want. nothing change. Sorry i am the new people in RTC so i really need help.

here is my build.xml

<xml>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <eclipse>
as the first entry and export the buildfile again. -->
<project>
<property>
<property>
<property>
<property>
<property>
<path>
<pathelement>
</path>
<target>
<mkdir>
<copy>
<fileset>
<exclude>
<exclude>
</fileset>
</copy>
</target>
<target>
<delete>
</target>
<target>
<target>
<target>
<target>
<echo>
<javac>
<src>
<classpath>
</javac>
</target>
<target>
<target>
<copy>
<fileset>
</copy>
<unzip>
<patternset>
<fileset>
</unzip>
</target>
<target>
<property>
<antcall>
</target>
<target>
<java>
<classpath>
</java>
</target>

<artifactFilePublisher>

<buildResultPublisher>
</project>





and this is my command for JBE

jbe -repository https://localhost:9443/ccm -userId adi -pass adi -engineId PreludeBuildEngine2



thank you


I can see a potential problem in your jbe commandline, it may not be a problem now but could be later. You should consider creating a new user that just handles builds (I created one called "build"). They should have a Build license (there are 50 supplied with RTC - then you don't use up your Developer licenses). Then add the "build" user to the project as a team member.

You also need to create a directory on your build machine - for "build" to grab the files from version control and do the build.

There is also a nice video on how to use RTC to package and deploy a build that might help:

http://jazz.net/library/video/490

regards

anthony

permanent link
Brent Ulbricht (2.5k11) | answered Mar 21 '11, 3:29 p.m.
JAZZ DEVELOPER
Hi,

Did you get a failed build when running with the copied snippet of XML? The reason I ask is that you'll need to change the 'download.zip' value to the location of the .war/.jar that you want to publish to the build result. I'm thinking that you may see a statement in the log that looks like the following error.

"filePath" contains path to non-existent file "C:\temp\fetched\proj1\data\artifacts\download.zip".

Brent Ulbricht
Developer/Lead - RTC Build

permanent link
adi hasan (86174) | answered Mar 22 '11, 12:16 a.m.
Hi,

Did you get a failed build when running with the copied snippet of XML? The reason I ask is that you'll need to change the 'download.zip' value to the location of the .war/.jar that you want to publish to the build result. I'm thinking that you may see a statement in the log that looks like the following error.

"filePath" contains path to non-existent file "C:\temp\fetched\proj1\data\artifacts\download.zip".

Brent Ulbricht
Developer/Lead - RTC Build



hi Friends,

I still don't get the download tab. i don't find the error report in the log file.

here is the log file:

2011-03-21 21:10:08 running on host: serverna-249a05
2011-03-21 21:10:08 Should build occur?
2011-03-21 21:10:08 Yes: Always build a user initiated request.
2011-03-21 21:10:09 Invoking pre-build participant "com.ibm.team.build.jazzscm"
2011-03-21 21:10:10 Accepting changes into workspace "Prelude Build Workspace 2" ...
2011-03-21 21:10:28 Fetching files to fetch destination "C:\Program Files\IBM\TeamConcertBuild\buildsystem\buildengine\eclipse\fetched" ...
2011-03-21 21:10:33 Invoking build participant "com.ibm.team.build.ant"
Buildfile: C:\Program Files\IBM\TeamConcertBuild\buildsystem\buildengine\eclipse\fetched\prelude project\build.xml

build-subprojects:

init:

build-project:
prelude project: C:\Program Files\IBM\TeamConcertBuild\buildsystem\buildengine\eclipse\fetched\prelude project\build.xml

build:

BUILD SUCCESSFUL
Total time: 0 seconds


i change the build.xml file, here is the build.xml :



<?xml version="1.0" encoding="UTF-8"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. -->
<project basedir="." default="build" name="prelude project">
<property environment="env"/>
<property name="ECLIPSE_HOME" value="../../../../../Program Files/IBM/TeamConcert"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.5"/>
<property name="source" value="1.5"/>
<path id="prelude project.classpath">
<pathelement location="bin"/>
</path>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
<src path="src"/>
<classpath refid="prelude project.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
<target name="HelloWorld">
<java classname="paket1.HelloWorld" failonerror="true" fork="yes">
<classpath refid="prelude project.classpath"/>
</java>
</target>

<target name="fetchCodeAndBuild">
<!-- Publish some links. -->
<artifactFilePublisher repositoryAddress="${repositoryAddress}"
userId="${userId}"
password="${password}"
buildResultUUID="${buildResultUUID}"
filePath="C:/outputbuild/download.zip"
label="a download" />
</target>
</project>



please help. thx

permanent link
Brent Ulbricht (2.5k11) | answered Mar 22 '11, 8:48 a.m.
JAZZ DEVELOPER
Hi,

It looks to me like you may need to change your build.xml to specify other targets to run or explicitly specify the targets to run when invoking Ant. I assume that currently you are running the default target of "build".


<project basedir="." default="build" name="prelude project">



The "build" target has dependencies on the "build-subprojects" and "build-project" targets, which do appear to run in your logs.


<target depends="build-subprojects,build-project" name="build"/>



The "build-subprojects" does not have any statements to perform.


<target name="build-subprojects"/>



That leaves the "build-project" target to perform work. It has a dependency on the "init" target and has compile statements. If you don't have the source code already in the directory, then it's probably not finding anything to compile.


<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
<src path="src"/>
<classpath refid="prelude project.classpath"/>
</javac>
</target>



The main thing that I see is that you're not running the target to publish any artifacts to the build result.

Brent Ulbricht
Developer/Lead - RTC Build

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.