Unable to use StartBuildActivityTask
Environment: RHEL 32-bit. Build toolkit for RTC 4.0.5.
I'm unable to get the following script to work:
<?xml version="1.0" encoding="UTF-8"?>
<!-- buildstep.xml -->
<project name="buildStep" default="report_task" basedir=".">
<taskdef name="startBuildActivity"
classname="com.ibm.team.build.ant.task.StartBuildActivityTask" />
<target name="report_task" description="Report task status to JBE" >
<startBuildActivity label="testlabel"
activityIdProperty="$testid"
autoComplete="true" />
</target>
</project>
Error:
14: pmn@rhel-pc /tmp > ant -f /tmp/buildstep.xml -lib /usr/opt/jazz/buildsystem/buildtoolkit
Buildfile: /tmp/buildstep.xml
BUILD FAILED
/tmp/buildstep.xml:5: taskdef class com.ibm.team.build.ant.task.StartBuildActivityTask cannot be found
Total time: 0 seconds
15: pmn@rhel-pc /tmp >
This doesn't work even when I include BuildToolkitTaskDefs.xml into buildstep.xml.
<import file="/usr/opt/jazz/buildsystem/buildtoolkit/BuildToolkitTaskDefs.xml" />
Contents of the build toolkit folder:
15: pmn@rhel-pc /tmp > ls -l /usr/opt/jazz/buildsystem/buildtoolkit/*.jar | wc -l
164
16: pmn@rhel-pc /tmp >
17: pmn@rhel-pc /tmp > ls -l /usr/opt/jazz/buildsystem/buildtoolkit/com.ibm.team.build.*
-rw-r--r-- 1 haddm ccusers 33879 Oct 26 2013 /usr/opt/jazz/buildsystem/buildtoolkit/com.ibm.team.build.client.nl1_3.0.6.v201310221950.jar
-rw-r--r-- 1 haddm ccusers 15034 Oct 26 2013 /usr/opt/jazz/buildsystem/buildtoolkit/com.ibm.team.build.client.nl2_3.0.3.v201211091526.jar
-rw-r--r-- 1 haddm ccusers 127159 Oct 26 2013 /usr/opt/jazz/buildsystem/buildtoolkit/com.ibm.team.build.client_3.0.700.v20130905_0016.jar
-rw-r--r-- 1 haddm ccusers 58848 Oct 26 2013 /usr/opt/jazz/buildsystem/buildtoolkit/com.ibm.team.build.common.nl1_3.1.4.v201310221950.jar
-rw-r--r-- 1 haddm ccusers 26532 Oct 26 2013 /usr/opt/jazz/buildsystem/buildtoolkit/com.ibm.team.build.common.nl2_3.1.3.v201310221941.jar
-rw-r--r-- 1 haddm ccusers 714943 Oct 26 2013 /usr/opt/jazz/buildsystem/buildtoolkit/com.ibm.team.build.common_3.1.600.v20131017_2200.jar
-rw-r--r-- 1 haddm ccusers 98519 Oct 26 2013 /usr/opt/jazz/buildsystem/buildtoolkit/com.ibm.team.build.toolkit.nl1_3.0.7.v201310221950.jar
-rw-r--r-- 1 haddm ccusers 42498 Oct 26 2013 /usr/opt/jazz/buildsystem/buildtoolkit/com.ibm.team.build.toolkit.nl2_3.0.5.v201305091343.jar
-rw-r--r-- 1 haddm ccusers 286508 Oct 26 2013 /usr/opt/jazz/buildsystem/buildtoolkit/com.ibm.team.build.toolkit_3.0.700.v20131015_0229.jar
18: pmn@rhel-pc /tmp >
What am I missing here?
Regards.
2 answers
This error usually comes up if you forget to include the BuildToolkitTaskDefs.xml. There is a description how to do that in https://jazz.net/help-dev/clm/topic/com.ibm.team.build.doc/topics/r_ant-tasks.html
Please check that you have actually followed these steps. You clami you did, however, the error indicates otherwise.
It says:
Please check that you have actually followed these steps. You clami you did, however, the error indicates otherwise.
It says:
To use these Ant tasks in your scripts, from installdir/buildsystem/buildtoolkit/BuildToolkitTaskDefs.xml, where installdir is the location where you installed the Ant build toolkit, copy the various taskdef entries in the BuildToolkitTaskDefs.xml file to your project's Ant script. You can also use your Ant script to import the taskdef file.
Note: If you use command line builds that need to call out to the Ant toolkit, add the location of the buildtoolkit directory to the Ant library path when invoking Ant. Typically, you perform this task by invoking Ant with the -lib argument. For example: ant -f build.xml -lib installdir/buildsystem/buildtoolkit .Note: For information about automating the builds of applications using the Rational® Application Developer for WebSphere® Software build utility (the build utility), see Automate the builds of applications.
[The file has the import BuildToolkitTaskDefs.xml line and the necessary jars.]
The error was due to a very old Ant installation.
The current verison of Ant (apache-ant-1.9.4-bin.tar.gz) was installed, the ANT_HOME environment variable was set to the Ant install dir, and its 'bin' folder was added to the PATH variable. This fixed the 'taskdef class not found' issue.
22: pmn@rhel-pc ~ > ant -f /tmp/buildstep.xml -lib /usr/opt/jazz/buildsystem/buildtoolkit
Buildfile: /tmp/buildstep.xml
report_task:
BUILD FAILED
/tmp/buildstep.xml:14: Missing required attribute "repositoryAddress".
Total time: 5 seconds
23: pmn@rhel-pc ~ >
23: pmn@rhel-pc ~ > ant -version
Apache Ant(TM) version 1.9.4 compiled on April 29 2014
24: pmn@rhel-pc ~ >
Comments
The call complains about a missing parameter. I don't think that has anything to do with the ANT version.
The first error ("
taskdef class com.ibm.team.build.ant.task.StartBuildActivityTask cannot be found"
) was what I was trying to get past. That was due to an ancient Ant installation on my Linux box.
The current error just says that I'm missing the required parameters to the
startBuildActivity
task. This IMHO is OK, because now I have got to the point where the task is being recognized. I can now work on providing the right parameters to this task. In other words, my issue has been resolved.
Comments
p m n
Jul 04 '14, 5:50 a.m.NOTE: Please ignore the