bndtools/bnd — Issue #110: corrupt images using bnd ant task
Author: rotty3000
Created: 2011-11-12 04:56:57+00:00
State: open

I'm creating a bundle which contains an image (icon.png) using the
following bnd.bnd + -wab macro:

-wab: \
{WEB-INF/bnd.bnd=bnd.bnd},\
{WEB-INF/liferay-display.xml=liferay-display.xml},\
{WEB-INF/liferay-plugin-package.properties=liferay-plugin-package.properties},\
{WEB-INF/liferay-portlet.xml=liferay-portlet.xml},\
{WEB-INF/portlet.xml=portlet.xml},\
{WEB-INF/web.xml=web.xml},\
{WEB-INF/src/=src/},\
{WEB-INF/tld/=tld/},\
{bundle_action.ftl=../bundle_action.ftl},\
{edit_bundle.ftl=../edit_bundle.ftl},\
{init.ftl=../init.ftl},\
{view.ftl=../view.ftl},\
{icon.png=../icon.png},{css/=../css/},{js/=../js/}

Here is the ant task:

Every other aspect of the bundle works perfectly. But, the resulting
jar contains a broken image file. Viewing the image either directly
from the jar or by extracting the jar and using any type of viewer
results in some message about the image being corrupt.

I have checked and rechecked that the image going into the process is
good, and displays fine but without fail the image is corrupt coming
out of the ant task.

I've confirmed that a normal jar operation does not result in the same problem.

I'm on Ubuntu Linux 11.04, using OpenJDK:

]$ java -version
java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.2) (6b22-1.10.2-0ubuntu1~11.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)

Both 1.44.0 and 1.50.0 versions of bnd were tested.