The Manifest editor updates
the manifest class path for a utility JAR or module in an enterprise
application. The Java™ build
path is updated accordingly for the containing project. It also sets
the Main Class attribute of the manifest, which is typically only
used for application client modules.
To use the Manifest editor, right-click
your project's MANIFEST.MF file and select . The Manifest editor consists of the following pages
and sections:
Dependencies page
The Manifest editor is designed for classpath editing. Therefore,
not all the attributes or information contained in the manifest file
(MANIFEST.MF) are represented in this topic.
- Classpath Scope section
- Use this section to select the enterprise application to use for
class path editing. The list contains all enterprise applications
which contain a reference to the current project as a module or utility
JAR. Use the Refresh button to update the list
if a change is made in a separate editor.
- Dependencies section
- Use this section to select other JAR files or modules contained
by the enterprise application that are required by the JAR file or
module you are currently working with. You can see existing class
path entries in the manifest file, and all available, valid entries
in the selected application in the preceding section.
In cases where
your module depends on an EJB module that has an EJB client JAR file,
you can choose whether you want to depend on the EJB JAR file or the
EJB client JAR file. If you select the Use EJB JARs radio button, the table does not show any EJB client JAR files.
If you select the Use EJB client JARs radio
button, the table does not show any EJB JAR files that have corresponding
EJB client JAR files. If you select the Allow both radio button, the table shows EJB JAR files and EJB client JAR files
and allows you to select both types.
Tip: The Dependencies
section automatically switches dependencies based on which radio button
you select. For example, if you have a dependency set on an EJB JAR
file and you select the Use EJB client JARs radio button, the dependency switches to the appropriate EJB client
JAR file. If you select the Allow both radio
button, none of your dependency selections changes automatically.
- Implementation Version section
- Use this section to specify a version for the JAR packaging.
- Annotation Scanning
- Use this section to specify archives and packages that you want
to exclude from annotation scanning. For more information on annotation
scanning see: Excluding files from annotation scanning
- Main Class section
- Use this section to set the main-class, or entry point, of the
application. The Main-Class attribute specifies the Java class of the application entry point.
.
Source page
It is
not necessary to manually edit manifest files in J2EE projects. However,
if you choose to manually edit these files, you should be aware of
some common limitations from the Manifest Format specification:
- The relative path of the file must be META-INF/MANIFEST.MF, in all capital letters.
- Lines in the file must be no greater than 72 characters. Continuation
of long lines is indicated by a carriage return and a space.
- The last line in the file must end in a carriage return, or it
does not get parsed.
For more information, refer to the official Manifest Format specification. The standard Java APIs are
used for reading and writing manifest files.
Adding a directory
to the MANIFEST.MF file
When you add a directory to the
MANIFEST.MF file, you receive an error message like the one below:
IWAE0024W The Manifest Class-Path for archive xyz.jar contains an entry,
properties, that is not resolveable to a file or module in the EAR:
sample...
The EJB specification is not explicit on this
issue. However, it does suggest that loose files within an EAR are
invalid. Currently, this configuration does work in the WebSphere® Application Server, but you should
not rely on this configuration working in the future. You can create
a Java project and add the property
files to a source folder (or the project if the project is the source
folder). On the Modules page of the application deployment descriptor
editor, you can add this Java project as a Project Utility JAR, then you can run the EAR file
in the WebSphere Test
Environment. When you export the EAR file, the Java project is automatically added to a JAR
and included in the EAR.
For information about Annotation scanning, see Excluding files from annotation scanning.