EAR Ant task

Convenient EAR Ant task based on the JAR task, that generates the application.xml taken from a set of 'EAR module' adapted FileSets, in addition to inserting the files them self.

Parameters

AttributeDescriptionRequired
destFileThe EAR file to create.Yes
displayNameDisplay name to insert into the application.xmlYes
smallIconIf present, will part of an 'icon' element of the application.xmlNo
largeIconIf present, will part of an 'icon' element of the application.xmlNo

Nested element: metainf

The nested metainf element specifies a FileSet, having Parameters like includes, excludes, etc. All files included in this fileset will end up in the META-INF directory of the EAR file.

Nested element: module

The nested module element specifies a FileSet, having Parameters like includes, excludes, etc. In addition it specifies the type of the module. All files included in this fileset end up in the root directory of the EAR file and are added to the generated application.xml with the proper module xml tag. The module element accepts the follwoing set of parameters.

AttributeDescriptionRequired
typeOne of 'java', 'ejb', 'web' or 'connector'. Default is 'java'Yes
contextIgnored for all other types than 'web'. Specifies the webapp name (context-root). If not defined, the base name of the WAR file(s) is used insted, prepended with '/'No

Nested element: securityRole

The nested securityRole element defines an (optional) 'security-role' element in the generated application.xml file. The securityRole element accepts the follwoing set of parameters.

AttributeDescriptionRequired
roleA security roleYes
descriptionA description for the roleNo

Example

<eartask
    destFile    ="${dist.dir}/myApp.ear"
    displayName ="The myApp EAR"
    description ="Bla bla bla bla bla bla bla bla bla bla bla bla bla"
    smallIcon   ="myApp-16.gif"
    largeIcon   ="myApp-32.gif"
    >
    <metainf dir="${conf.dir}" includes="jboss-app.xml" />

    <module type="web"  dir="${build.dir}" includes="*.war"        excludes="*-webapp.war" />
    <module type="web"  dir="${build.dir}" includes="foo-webapp.war" context="/foo" />

    <module type="java" dir="${lib.dir}" includes="*.jar"        excludes="*-ejb.jar" />

    <module type="ejb"  dir="${build.dir}" includes="*-ejb.jar" />

    <module type="connector"  dir="${build.dir}" includes="*.rar" />

    <securityRole name="jBond"  description="I. Flemming"/>
    <securityRole name="jClark" description="T. Clancy"/>
</eartask>

Limitations

In this version of the task, there are no support for, (1) A different EAR DTD than version 1.3 (2) The 'alt-dd' element inside a module element, in application.xml