Ear tasks overrides default application.xml

I’ve sorted it out. Jboss 5.1.GA needs the old 1.3 DTD spec, so with version I can set this. Apart from that one should not add a description in the ear closure, this is hardcoded to be a Node before display-name, and this is not expected by the application_1_3.dtd specification.

Also I needed to tweak to generated application.xml with the following, otherwise the application.xml is still rejected.

/**
 We need to adjust the generated XML somewhat, in order to be compatible with DTD version 1.3 of the application.xml spec.
 */
          withXml { application ->
   // fetch the whole xml
            def applicationXML =
application.asNode()
  // find the library-directory node, not used by spec 1.3
            def libraryDirectory = applicationXML.find { it.name() == 'library-directory' }
   //remove this library-directory folder
            applicationXML.remove(libraryDirectory)
  // also remove the version attribute in the application node
            applicationXML.attributes().remove('version')
                  }

If you need 1.3 spec, this might help you.