[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Building maven packages



Hi Wookey,

Le 3/11/2016 à 03:16, Wookey a écrit :

> Can someone explain what these osgi 'bundles' are? How does that
> relate to the .jars I am familiar with? The same stuff packaged up in
> a different format? Who uses those? Are they any use in Debian packages?

An OSGi bundle is just a jar file with extra metadata in its MANIFEST.MF
file. These metadata define the name of the bundle, the Java packages it
depends on and the Java packages it exports. This information is used by
an OSGi framework to wire the bundles and isolates the classpaths.


> Is it right to be using cdbs (to drive mh*), when dh (driving mh*) is
> generally preferred these days? I don't mind cdbs personally, but
> wonder if this is optimal - is that just what mh_make defaults to?

maven-debian-helper supports both CDBS and DH. Historically CDBS support
was implemented first so we have a lot of packages using it, but we are
gradually migrating them to DH.

For a Maven build prior to DH 10 you would use in debian/rules:

    dh $@ --buildsystem=maven

Starting with DH 10 Maven builds are automatically detected and the
--buildsystem parameter is no longer required (except if there is also
an Ant build.xml file in the root directory).

mh_make generates DH style rules files since the version 1.7 (in stretch
and jessie-backports).


> it is that there is no such thing as dh --with-maven-helper yet?

There is also maven-repo-helper that can be used to install Maven
artifacts in a package not build with Maven:

    dh $@ --with maven-repo-helper

This will install the artifacts defined in debian/<package>.poms


> Doing this doesn't make it build. It still fails with:

> [ERROR] [ERROR] Some problems were encountered while processing the POMs:
> [ERROR] Unknown packaging: bundle @ line 7, column 13
> [ERROR] Unknown packaging: so @ line 7, column 13

Did you ignore the maven-bundle-plugin? If so you have to change the
packaging type in the pom.xml files from 'bundle' to 'jar'. But enabling
the plugin should be straightforward.


> Yep - that worked. How could I have worked out myself that
> complaints about apache.felix meant I wanted that package?

By asking for help to the Java Team ;)

Emmanuel Bourg


Reply to: