Building Modeshape with Jenkins

Modeshape is a data store that can be accessed by the standard Java API for content repositories (JCR, JSR-283). To build it from its github-repo, two points are important: First, use

clean install -s settings.xml

as Maven-goal, so that the settings from the repo apply. Second, do not use port 8090 for jenkins (or anything else on the ci-server, 8095 is fine), since tests executed during the build-process need this port.

Veröffentlicht unter Uncategorized | Kommentare deaktiviert

Uploading zip-files to Jackrabbit via WebDAV

Trying to add files to a local Jackrabbit-Standalone repository via WebDAV, I was not able to upload zip-files being larger than just some kB. The upload took extremely long and terminated with an exception/internal server error:

com.github.sardine.impl.SardineException: Unexpected response (500 I
at com.github.sardine.impl.handler.ValidatingResponseHandler.validat
at com.github.sardine.impl.handler.VoidResponseHandler.handleRespons
at com.github.sardine.impl.handler.VoidResponseHandler.handleRespons
at org.apache.http.impl.client.CloseableHttpClient.execute(Closeable
at org.apache.http.impl.client.CloseableHttpClient.execute(Closeable
at com.github.sardine.impl.SardineImpl.execute(SardineImpl.java:808)
at com.github.sardine.impl.SardineImpl.put(SardineImpl.java:740)
at com.github.sardine.impl.SardineImpl.put(SardineImpl.java:723)
at com.github.sardine.impl.SardineImpl.put(SardineImpl.java:711)
at com.github.sardine.impl.SardineImpl.put(SardineImpl.java:681)
at com.github.sardine.impl.SardineImpl.put(SardineImpl.java:674)
at com.github.sardine.impl.SardineImpl.put(SardineImpl.java:667)

The reason for this is that Jackrabbit tries to process the Zips while uploading, which apparently only works for small files. What I wanted was that Jackrabbit stores zips just as other files without processing them. This can be achieved by editing the WEB-INF/config.xml (in my case, with the Standalone-Version, right in the jackrabbit-jar) and comment the lines, that define the manager for Zips, out:

Changes in WEB-INF/config.xml

That way, jackrabbit treats Zips being uploaded via WebDAV just as ordinary files and stores them without any further processing.

 

Veröffentlicht unter Jackrabbit, WebDAV | Kommentare deaktiviert

Reducing the size of an exported Eclipse RCP application

After exporting a newly developed Eclipse RCP application for the first time as a stand-alone product, you will notice that the resulting app is everything but “tiny”. So, users or customers will face a reasonably large download. And additionally, assuming that the startup-time of the application is somewhat proportional to its overall size, shrinking the application-size as much as possible is gernerally a major concern (usability-wise, if we want people to like our app) once the basic functionality is implemented.

To have a generic example that everyone can follow with little initial effort, I start here by using the “Mail”-example coming with every Eclipse RCP distro. If you create the app and export it the way described here (please follow steps 1-10, I use the project-names from there), you will end up with an application-folder of 18.4 MB (Eclipse Indigo on Windows, there may be small variations with other distros). If you look into the plugin-folder, the largest contribution to your app-size stems from the com.ibm.icu_4.4.2.v20110208.jar, which alone has a size of 6.4 MB (you can learn more about this plugin here). But, maybe you do not need the functionality this plugin, which is by default included in every exported RCP-app, provides? If so, there is a replacement library (com.ibm.icu.base), and I will explain now how to use that instead in your export configuration.

1. Make com.ibm.icu.base available in your IDE

1.1 Add the Orbit update-site

You can obtain the replacement-plugin from the update site of the Eclipse Orbit project (use the previous link or find the newest update-site-url on the downloads-section of Orbit, go to the youngest recommended build). In Eclipse, go to “Help”->”Install new software”, press the “Add”-button on the top-right and put in a name and the url for the Orbit update-site:

Press “Ok”, and wait until the content of the update-site has been retrieved.

1.2 Install the com.ibm.icu replacement plugin

Use “icu” as filter-text, and the com.ibm.icu-replacement-plugin will be offered. Select its checkbox:

Then press “Next” and “Finish” on the wizard-pages. Restart when you are asked for it. The plugin is then installed and available in your Eclipse.

2. Use the replacement-plugin in the exported app

2.1 Get the list of included plugins from org.eclipse.rcp

If you followed the 10 steps from the tutorial referenced in the beginning of this article, you have a feature-project “com.example.mail.core” in your workspace. Open the feature.xml with a double-click and go to the tab “Included features”. The only entry will be “org.eclipse.rcp”:

Double-click on the “org.eclipse.rcp” entry, this will open the editor for the feature (read-only), and go to the tab “Plug-ins”. Select everything except “com.ibm.icu” (use “shift” or “ctrl” when clicking), right-click on what you selected and choose “Copy”:

2.2 Add plugins to your feature.xml

Go back to your feature.xml from “org.example.mail.core” and open the “Plug-ins” tab there. Right-click below the “com.example.mail”-plugin and choose “Paste”. The list of plugins you previously copied should have been added then.

Having added the plugins the “Mail”-app depends on, we still need to add the com.ibm.icu-replacement. Click on the “Add” button, enter “com.ibm.icu.base” in the upper text-field, select the (one) listed plugin and press “Ok”. You have now all the plugins you need in the Mail-app defined in its feature:

2.3 Remove org.eclipse.rcp from your feature

The only thing left now is to remove the “org.eclipse.rcp”-feature from the Mail-app, so go to the tab “Included features”, right-click on the only entry and choose “Delete”:

Save the feature, and you are done!

3. Export and check the result

Now, when you export your app again via “File”->”Export”, you can check again the plugins-folder and there should now be the “com.ibm.icu.base_4.4.2.v20110208.jar” with a size of only 123 kB. What a replacement! The size of the exported product went down to 12.0 MB on my system, which is a decrease of roughly 35% of the overall project size. Sure, this ratio will decrease in larger projects, but still…

I hope you enjoyed going through this post, please feel free to add your ideas and comments!

 

Veröffentlicht unter Eclipse RCP | Verschlagwortet mit , , , , , | Hinterlasse einen Kommentar