It's all about the answers!

Ask a question

Unable to use StartBuildActivityTask


p m n (271913) | asked Jul 04 '14, 5:39 a.m.
edited Jul 13 '14, 8:44 a.m. by Jennifer Cianchetta-Riordan (2512)
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.


Comments
p m n commented Jul 04 '14, 5:47 a.m. | edited Jul 04 '14, 5:50 a.m.

NOTE: Please ignore the 

<="" i=""> in the above file. They are not part of the actual file. 

2 answers



permanent link
Ralph Schoon (60.7k33643) | answered Jul 04 '14, 7:42 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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:


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.

permanent link
p m n (271913) | answered Jul 09 '14, 4:30 a.m.
[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
Ralph Schoon commented Jul 09 '14, 8:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

The call complains about a missing parameter. I don't think that has anything to do with the ANT version.


p m n commented Jul 09 '14, 9:16 p.m. | edited Jul 09 '14, 9:19 p.m.

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.


Your answer


Register or to post your answer.