A module is packaged
with all the necessary dependent JAR files, classes, and a
module.properties file along with a .feature file.
The
.feature (pronounced "dot-feature") file is placed in
the same folder as the root of the project. This file shows the JAR associated
with this module and the path to the dependent JAR files. The name of the
.feature file is
<moduleID>-module.feature.
We recommend you to
use the Apache ANT™ build tool that comes with Eclipse. You can also use any
other build tool or create the build by yourself, but you have to deliver a
package with the same characteristics as one built with ANT.
The following
example shows the content of a
.feature file:
{
jars: [ "features/feature-chargeback.jar",
"features/chargeback/activation-1.1.jar",
"features/chargeback/axis2-jaxbri-1.5.6.jar",
"features/chargeback/bcel-5.1.jar",
"features/chargeback/jalopy-1.5rc3.jar",
"features/chargeback/neethi-2.0.5.jar",
"features/chargeback/antlr-2.7.7.jar",
"features/chargeback/axis2-jaxws-1.5.6.jar",]
features: [ "com.cloupia.feature.oabc.OABCModule" ]
}
From the build.xml
file, run the ANT target build. This action generates the necessary zip file
and save it to the base directory of your project. (This assumes that you are
using the sample project as the base of your own project. Although using the
sample project in this way is not recommended, it is the basis of this
demonstration.)
If your module
depends on JARs that are not provided with the sample source code, include the
jars in the build.xml file to have them in the zip file.
The following
example shows a module layout with a third-party JAR:
feature-oabc
feature oabc.jar
oabc
lib
flex
flex-messaging-common.jar
oabc.feature
The module jar and
.feature are at the top level of the zip file. Place
the third-party jars under the
/moduleID/lib/ folder path. Although it is not
required, the best practice is to place the third-party jars under the
/moduleID/lib folder path, then any other sub
directories you may want to add.
{
jars: [ 'features/feature-oabc.jar", features/oabc/lib/flex-messaging-common.jar ],
features: [ "com.cloupia.feature.oabc.OABCModule" ]
}
References to the
jar files must always start with
features/. When you list the jars in the
.feature file, ensure that the jars start with
features/. This action enables you to include the
path to the jar. The path of each jar must be the same path that is used in
your zip file. The best practice is to lead with your module jar, followed by
its dependencies, to ensure that your module gets loaded.