Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[wtp-dev] Jarring plugins


I've jarred most of my WTP plugins already, so at David's request here is a quick primer on how to convert your plugins (bundles) to Jar files:

What are we talking about?
Converting plugins/bundles from the expanded directory structure into regular Java Jar files.

Why do we want to do this?
The main reason is install space - zipping up plugins reduces the disk footprint of plugins that have lots of resources (due to zipping + no wasted disk clusters). The best examples are UI plugins with lots of icons, (for example, we can reduce the size of j2ee.ui by about 30%) but it'll help to a lesser degree for all plugins.
The other reasons for this change are faster install/uninstall (unzipping/deleting a single file is quicker), moving to a standard format, and using less file handles.

How long will it take me?
See the restrictions below - if your plugins pass it will only take a few minutes to update your plugins and a few minutes + testing afterward. If not, you'll need to fix the restrictions before trying this.

What are the restrictions?
You can't convert a plugin that still has a dependancy on reading directly from a file on disk (e.g. test plugins that contain an Ant test.xml, or plugins that get a plugin's location on disk and find a relative file instead of using Bundle.getEntry()). Most plugins should be fine, and in many of these oddball/legacy cases we should be opening bugs.
Another drawback is that all classes have to be merged into one jar file, so you should not jar up plugins that contain external jars. (e.g. Eclipse did not jar the Ant or JUnit plugins) If you have multiple jars in your plugin, you'll have to decide whether they can/should be merged or not.

So what do I do?
Please see the link below. The basic steps are:
  * Remove classpath entry from the manifest.
  * Change the to remove references to the jar and use ".." to build the jar at the root of the bundle.
  * Add 'unpack="false"' to the feature's reference to the plugin.

Any WTP-specific issues?
Jeffrey already helped me iron out the WTP build, so everything should be fine there.
Any plugins that are required by the Web services' web app can't be jarred until its build script supports jarred plugins.
I noticed that the WTP build left duplicate copies of all my class files inside the jar. They were in a @dot folder (a temporary directory used during the build) within the jar. This should probably be automatically deleted, but I removed it by adding a bin.excludes on "@dot/**" to my
In general, look at the jar files that are produced and do some testing to ensure that everything is ok.

For more details
The original documentation for this change is at:

Hope this helps,
Tim deBoer
WebSphere Tools - IBM Canada Ltd.
(905) 413-3503  (tieline 969)

Back to the top