commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernd Eckenfels (JIRA)" <>
Subject [jira] [Commented] (CONFIGURATION-639) OSGi Import-Package declaration not complete regarding optional dependencies
Date Thu, 08 Sep 2016 15:56:21 GMT


Bernd Eckenfels commented on CONFIGURATION-639:

Well, it was my first feeling too, but on the other hand from experience I can say this is
not an issue. The dependencies in such projects are mostly not up-to-date, so if somebody
uses it they have a wide range of versions which are accepted (anything more current up to
the next major). If a project is quick to update the dependencies then it is also seldomly
a problem since the new version of that gets only dragged in by projects updating anyway.
So while it might restrict some situations it typially is not an issue. Especially given that
fact that only because there is no version restriction does not mean the unrestricted artifact
in a odd version actually works.

However this might be a bigger change than a bugfix. So I guess the plugin should be configured
to not provide version ranges (but optionals) for the next minor release.

> OSGi Import-Package declaration not complete regarding optional dependencies
> ----------------------------------------------------------------------------
>                 Key: CONFIGURATION-639
>                 URL:
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: OSGi-container
>            Reporter: Rico Neubauer
>              Labels: commons-configuration, osgi
>         Attachments: s1.txt, s2.txt
> common-configuration2's pom.xml correctly defines optional dependencies like vfs2 or
spring with <optional>.
> However, it does only declare a subset of those as optional OSGi-dependencies:
> {code:xml}
>     <!-- Explicitly declare optional dependencies for the OSGi manifest. -->
>     <commons.osgi.import>
>       org.apache.commons.beanutils.*;resolution:=optional,
>       org.apache.commons.codec.*;resolution:=optional,
>       org.apache.commons.jxpath.*;resolution:=optional,
>       org.apache.xml.resolver.*;resolution:=optional,
>       javax.servlet.*;resolution:=optional,
>       org.apache.commons.jexl2.*;resolution:=optional,
>       org.apache.commons.vfs2.*;resolution:=optional,
>       *
>     </commons.osgi.import>
> {code}
> See for both above.
> Due to the missing "resolution:=optional, commons-configuration2 cannot be deployed in
an OSGi-environment not providing the optional bundles.
> Example error on deploy:
> {code}
> Unable to resolve Module[org.apache.commons.configuration:2.1.0]: missing requirement
[Module[org.apache.commons.configuration:2.1.0]] package; (package=org.springframework.beans.factory)
> {code}
> Please have a look if you agree and add the missing instructions for the remaining optional
> Manually fixed Import-package statement looks like this (disregarding line-breaks):
> {code}
> Import-Package: javax.naming,javax.servlet;resolution:=optional,javax.sql,javax.xml.parsers,javax.xml.transform,javax.xml.transform.dom,,org.apache.commons.beanutils;resolution:=optional,org.apache.commons.codec.binary;resolution:=optional,org.apache.commons.jexl2;resolution:=optional,org.apache.commons.jxpath;resolution:=optional,org.apache.commons.jxpath.ri;resolution:=optional,org.apache.commons.jxpath.ri.compiler;resolution:=optional,org.apache.commons.jxpath.ri.model;resolution:=optional,org.apache.commons.lang3;version="[3.3,4)",org.apache.commons.lang3.builder;version="[3.3,4)",org.apache.commons.lang3.concurrent;version="[3.3,4)",org.apache.commons.lang3.mutable;version="[3.3,4)",org.apache.commons.lang3.text;version="[3.3,4)",org.apache.commons.lang3.text.translate;version="[3.3,4)",org.apache.commons.logging;version="[1.2,2)",org.apache.commons.logging.impl;version="[1.2,2)",org.apache.commons.vfs2;resolution:=optional,org.apache.commons.vfs2.provider;resolution:=optional,org.apache.xml.resolver;resolution:=optional,org.apache.xml.resolver.helpers;resolution:=optional,org.apache.xml.resolver.readers;resolution:=optional,;resolution:=optional,org.springframework.beans.factory;resolution:=optional,org.springframework.core.env;resolution:=optional,;resolution:=optional,org.springframework.util;resolution:=optional,org.w3c.dom,org.xml.sax,org.xml.sax.helpers
> {code}

This message was sent by Atlassian JIRA

View raw message