Skip to main content

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


"What are the restrictions?
..

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. "

The jarring documentation says that the output and source lines in build.properties should be changed to
output.myjar.jar = output..
source.myjar.jar = source..

Does this method work with multiple source trees in the same plugin or do the source trees have to be combined as well?

Thanks,

Lawrence Mandel

Software Developer
IBM Rational Software
Phone: 905 - 413 - 3814   Fax: 905 - 413 - 4920
lmandel@xxxxxxxxxx



Timothy Deboer/Toronto/IBM@IBMCA
Sent by: wtp-dev-bounces@xxxxxxxxxxx

05/31/2005 02:50 PM

Please respond to
"General discussion of project-wide or architectural issues."

To
wtp-dev@xxxxxxxxxxx
cc
Subject
[wtp-dev] Jarring plugins






Hi,


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 build.properties 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 build.properties.

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:

http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-core-home/documents/3.1/run_from_jars.html


Hope this helps,

Tim deBoer
WebSphere Tools - IBM Canada Ltd.
(905) 413-3503  (tieline 969)
deboer@xxxxxxxxxx
_______________________________________________
wtp-dev mailing list
wtp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/wtp-dev


Back to the top