![]() ![]() ![]() ![]() ![]() ![]() ![]() |
The following sections describe the steps for building WebLogic Server J2EE applications using the WebLogic split development directory environment:
You use the wlcompile Ant task to invoke the javac compiler to compile your application's Java components in a split development directory structure. The basic syntax of wlcompile
identifies the source and build directories, as in this command from the helloWorldEar
sample:
<wlcompile srcdir="${src.dir}" destdir="${dest.dir}"/>
The following is the order in which events occur using this task:
WL_HOME\samples\server\examples\build\helloWorldEar\APP-INF\classes\
where WL_HOME is the WebLogic Server installation directory.
More complex Enterprise applications may have compilation dependencies that are not automatically handled by the wlcompile task. However, you can use the include and exclude options to wlcompile to enforce your own dependencies. The includes and excludes properties accept the names of Enterprise Application modules—the names of subdirectories in the Enterprise application source directory—to include or exclude them from the compile stage.
The following line from the helloWorldEar
sample shows the appStartup
module being excluded from compilation:
<wlcompile srcdir="${src.dir}" destdir="${dest.dir}"
excludes="appStartup"/>
Table 4-1 contains Ant task attributes specific to wlcompile.
Specifies a directory of shared J2EE libraries to add to the classpath. See Creating Shared J2EE Libraries and Optional Packages.
|
The wlcompile Ant task can accept nested javac options to change the compile-time behavior. For example, the following wlcompile
command ignores deprecation warnings and enables debugging:
<wlcompile srcdir="${mysrcdir}" destdir="${mybuilddir}">
<javac deprecation="false" debug="true"
debuglevel="lines,vars,source"/>
</wlcompile>
Most WebLogic services are based on J2EE standards and are accessed through standard J2EE packages. The Sun, WebLogic, and other Java classes required to compile programs that use WebLogic services are packaged in the weblogic.jar
file in the lib
directory of your WebLogic Server installation. In addition to weblogic.jar
, include the following in your compiler's CLASSPATH:
lib\tools.jar
file in the JDK directory, or other standard Java classes required by the Java Development Kit you use.
The library
element is an optional element used to define the name and optional version information for a module that represents a shared J2EE library required for building an application, as described in
Creating Shared J2EE Libraries and Optional Packages. The library
element can be used with both wlcompile
and wlappc
, described in
Building Modules and Applications Using wlappc
.
The name and version information are specified as attributes to the library element, described in Table 4-2.
The format choices for both specificationversion
and implementationversion
are described in Referencing Shared J2EE Libraries in an Enterprise Application. The following output shows a sample library
reference:
<library file="c:\mylibs\lib.jar" name="ReqLib" specificationversion="90Beta" implementationversion="1.1" />
The weblogic.appc
compiler generates JSPs and container-specific EJB classes for deployment, and validates deployment descriptors for compliance with the current J2EE specifications. appc
performs validation checks between the application-level deployment descriptors and the individual modules in the application as well as validation checks across the modules.
wlappc is the Ant task interface to the weblogic.appc compiler. The following section describe the wlappc
options and usage.
Both weblogic.appc
and the wlappc
Ant task compile modules in the order in which they appear in the application.xml
deployment descriptor file that describes your Enterprise application.
Table 4-3 describes Ant task options specific to wlappc. These options are similar to the weblogic.appc command-line options, but with a few differences.
Notes: | See weblogic.appc Reference for a list of weblogic.appc options. |
Note: | See also Library Element for wlcompile and wlappc. |
Specifies a directory of shared J2EE libraries to add to the classpath. See Creating Shared J2EE Libraries and Optional Packages.
|
|||
|
|||
The basic syntax for using the wlappc Ant task determines the destination source directory location. This directory contains the files to be compiled by wlappc.
<wlappc source="${dest.dir}" />
The following is an example of a wlappc Ant task command that invokes two options (idl and idlOrverWrite) from Table 4-3.
<wlappc source="${dest.dir}"idl="true" idlOrverWrite="true" />
There are some syntax differences between appc and wlappc. For appc, the presence of a flag in the command is a boolean. For wlappc, the presence of a flag in the command means that the argument is required.
To illustrate, the following are examples of the same command, the first being an appc command and the second being a wlappc command:
java weblogic.appc -idl foo.ear
<wlappc source="${dest.dir} idl="true"/>
The following sections describe how to use the command-line version of the appc
compiler. The weblogic.appc command-line compiler reports any warnings or errors encountered in the descriptors and compiles all of the relevant modules into an EAR file, which can be deployed to WebLogic Server.
Use the following syntax to run appc:
prompt>java weblogic.appc [options] <ear, jar, or war file or directory>
The following are the available appc options:
A comma-separated list of shared J2EE libraries. Optional name and version string information must be specified in the format described in Referencing Shared J2EE Libraries in an Enterprise Application.
|
|||
|
|||
![]() ![]() ![]() |