Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-639

OSGi Import-Package declaration not complete regarding optional dependencies

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1.1
    • Component/s: None
    • Environment:

      OSGi-container

      Description

      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:

          <!-- 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>
      

      See https://github.com/apache/commons-configuration/blob/trunk/pom.xml 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:

      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)
      

      Please have a look if you agree and add the missing instructions for the remaining optional dependencies.

      Manually fixed Import-package statement looks like this (disregarding line-breaks):

      Import-Package: javax.naming,javax.servlet;resolution:=optional,javax.sql,javax.xml.parsers,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.stream,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,org.apache.xml.resolver.tools;resolution:=optional,org.springframework.beans.factory;resolution:=optional,org.springframework.core.env;resolution:=optional,org.springframework.core.io;resolution:=optional,org.springframework.util;resolution:=optional,org.w3c.dom,org.xml.sax,org.xml.sax.helpers
      

        Attachments

        1. s2.txt
          4 kB
          Bernd Eckenfels
        2. s1.txt
          4 kB
          Bernd Eckenfels

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                riconeubauer Rico Neubauer
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: