[ 
https://issues.apache.org/jira/browse/COMPRESS-456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16517203#comment-16517203
 ] 

Oliver Heger commented on COMPRESS-456:
---------------------------------------

Making all imports optional is not very OSGi-like, as some of them are for sure 
required.

It is possible to define a number of package imports as optional and use the 
'*' als fallback to automatically import all other referenced packages.  
[Configuration] does this, which also has a number of optional dependencies. In 
the _<properties>_ section of the pom, there is the following declaration:
{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,
      org.springframework.*;resolution:=optional,
      com.fasterxml.jackson.*;resolution:=optional,
      org.yaml.snakeyaml.*;resolution:=optional,
      *
    </commons.osgi.import>
{code}

> Missing OSGI Import-Package
> ---------------------------
>
>                 Key: COMPRESS-456
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-456
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Build
>    Affects Versions: 1.17
>            Reporter: Jérémie Brébec
>            Priority: Major
>             Fix For: 1.18
>
>
> The configuration of the maven-bundle-plugin overrides the <Import-Package> 
> directive : "*" is not present anymore, and severals packages do not resolve 
> correctly.
> For example, "javax.crypto", which is used by 7z encryption, is not resolved 
> and using this feature fails with a ClassNotFoundException on 
> javax.crypto.SecretKey.
> ahma I think that the correct Import-Package directive should be :
> {code:java}
> <Import-Package>*;resolution:=optional</Import-Package>{code}
> this directive will import everything commons-compress depends on, but with 
> an optional resolution (and so every dependencies will be optionals)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to