Download WebSphere Studio Application Developer

Transcript
20.5.1 Classpath Problem
The classpath, specified in the property as Java build path, is not used in the Ant
process. If one project is referencing the other project, the classpath must be
specified as follows. In this case, it is referring to JUnit Java project.
<javac srcdir="${src}" destdir="${build}" includes="**/*.java">
<classpath>
<pathelement location="../JUnit"/>
</classpath>
</javac>
20.6 Working with J2EE
During development, some of the deployment descriptor information is stored in
ASCII XML files, but these files also contain some information in a format
convenient for interactive testing and debugging. That is part of the reason it is
convenient and quick to test J2EE applications on the internal WebSphere
Application Server included with Application Developer. As part of the Application
Developer functionality that creates standalone J2EE modules, this internally
optimized deployment descriptor information is merged and changed into a
standard format. The actual EAR being tested, and its WAR, EJB, and
ClientApplication JARs, are not actually created as a standalone JAR file.
Instead, a special EAR is used that simply points to the build contents of the
various J2EE projects. Since these various individual projects can be anywhere
on the development machine, absolute path references are used.
When an Enterprise Application project is exported, a true standalone EAR is
created, including all the module WARs, EJB JARs, and Java utility JARs it
contains. Hence, during the export operation, all absolute paths are changed into
self-contained relative references within that EAR. To create a J2EE compliant
WAR or EAR we need to use Application Developer export function, or create an
AntTask to do so.
20.6.1 Ant Extra plug-in
What you need is a set of Application Developer Ant tasks to perform these build
and export functions. Here is a plug-in to do these Ant tasks. In addition to the
Ant tasks for the various J2EE export operations, it also includes Ant tasks to
perform an EJB Deploy and to build Java utility JARs and include them within Ant
builds of EARs. Specifically, these new Ant tasks are:
򐂰 ejbDeploy: Generates deployment code and RMIC code for an EJB Project.
򐂰 ejbExport: Exports an EJB project to an EJB JAR file.
450
WebSphere Studio Application Developer Programming Guide