9.6 Specifying Different EJB Specifications

9.6.1 Problem

You need to change the EJB specification used when generating EJB files.

9.6.2 Solution

Change the ejbdoclet attribute ejbspec to "1.1" or "2.0".

9.6.3 Discussion

By default, the current version of the ejbdoclet task creates files based on the 2.0 version of the EJB specification. If you need to change this to an earlier version of the EJB specification, simply change the ejbdoclet attribute ejbspec. Here's an example:

<ejbdoclet
    ejbspec="1.1"
    destdir="${dir.generated.src}"
    force="${force.ejb}">

  <!-- all subtasks left out for brevity --> 
</ejbdoclet>

The only supported EJB specifications are 1.1 and 2.0.

If your project must run on 1.1 and 2.0-compliant servers, the build process can emit multiple versions of the application, one for each specification.

9.6.4 See Also

Recipe 9.5 shows how to generate an EJB deployment descriptor.