Description of problem: Try to create a bundle with this recipe and you'll see that you get an error during the server plugin parsing and the bundle never gets created. ---- <?xml version="1.0"?> <project name="small-bundle" default="main" xmlns:rhq="antlib:org.rhq.bundle"> <rhq:bundle name="Small Bundle" version="1.0" description="a small bundle with a small.properties file"> <rhq:deployment-unit name="jar"> <rhq:file name="small-v1.properties" destinationFile="small.properties" replace="false"></rhq:file> </rhq:deployment-unit> </rhq:bundle> <target name="main"></target> </project> ---- This is very bad - you cannot create any bundles now.
I'm slowly stepping through the ant code to find out why this is happening. In ant-1.8.0.jar, there is org/apache/tools/ant/antlib.xml that has <antlib> <!-- This is the ant lib definition for ant. Currently it only contains componentdefinitions (restricted types that are not allowed at the top level) - conditions, selectors and comparators (those that are not top-level types (taskdefs or typedefs). defined in defaults.properties of taskdefs and types packages). This is currently experimental and it is most likely that these definitions will be placed in a Java Ant definition class. --> <!-- conditions --> <componentdef name="and" onerror="ignore" classname="org.apache.tools.ant.taskdefs.condition.And"/> ... And its this "componentdef" element that is causing the failure. Caused by: jar:file:/home/mazz/source/rhq/dev-container/jbossas/server/default/tmp/rhq-serverplugin-ant-bundle-4.0.0-SNAPSHOT.jar8787925329015629249.classloader/ant-1.8.0.jar3111823738470452321.tmp!/org/apache/tools/ant/antlib.xml:37: Problem: failed to create task or type componentdef Cause: The name is undefined. Action: Check the spelling. Action: Check that any custom tasks/types have been declared. Action: Check that any <presetdef>/<macrodef> declarations have taken place. at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java:487) at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:419) at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:163) at org.apache.tools.ant.taskdefs.Antlib.execute(Antlib.java:162) at org.apache.tools.ant.taskdefs.Definer.loadAntlib(Definer.java:443) I have no idea how any of this worked before. This is nothing that we apparently touched recently and this is core Ant stuff. Perhaps its introduced with ant 1.8? But I thought RHQ 3.0.0.GA shipped with that version?
geezz... http://ant.1045680.n5.nabble.com/Failed-to-create-task-error-in-ant-td2263552.html "I got the same error. Fixed as follows: replaced the all componentdef to typedef into <ant_home_dir>/lib/ant.jar!/org/apache/tools/ant/antlib.xml file. Works fine!! ;)" Here's another odd one, but doesn't look as authoritative as above: http://osdir.com/ml/user-ant-apache/2010-04/msg00081.html "I found a workaround. ... if I put a property task before the import, it seems to work fine. ... I have no idea why this same issue doesn't happen in either command line with Ant 1.8, or with Eclipse using Ant 1.7."
spent today doing git bisect and found the following as the commit that introduced the problem: ---------------------------- 9972429183bee20d1a973eae55c1c9b75832b546 is first bad commit commit 9972429183bee20d1a973eae55c1c9b75832b546 Author: Filip Drabek Date: Fri Nov 5 10:39:42 2010 +0100 code coverage - new profile for plugin modules, antrun plugin version specified in parent module, test scope removed because of maven3 ---------------------------- The commit's parent (which was the last good one prior to that) is: a95553d4829046f234204008881e62be1b0ad16e
I think this is fixed by adding <scope>test</scope> to the root pom.xml's cobertura dependency. testing now...
this fixes the problem : b37f3e2278ca08f5eddb43e275e300642fa9d850 that's the fix to bug 663517.
Verified on Build#1056 (Version: 4.0.0-SNAPSHOT Build Number: 643ac4b) with the bundle creation with recipe option. Tried the recipe: <?xml version="1.0"?> <project name="small-bundle" default="main" xmlns:rhq="antlib:org.rhq.bundle"> <rhq:bundle name="Small Bundle" version="1.0" description="a small bundle with a small.properties file"> <rhq:deployment-unit name="jar"> <rhq:file name="small-v1.properties" destinationFile="small.properties" replace="false"></rhq:file> </rhq:deployment-unit> </rhq:bundle> <target name="main"></target> </project> The bundle got created successfully. Also created a bundle distribution file with above recipe and uploaded and created bundle successfully. Marking the bug as verified.
Bookkeeping - closing bug - fixed in recent release.