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

Christoph Loy commented on COMPRESS-660:
----------------------------------------

Thanks for the quick response!

 

The change you suggest would unfortunately not fix the issue. What I need is 
that every package import that comes from org.apache.commons.codec also has a 
resolution:=optional attribute. So in your concrete example, I need to replace 
this:

 
{code:java}
org.apache.commons.codec,org.apache.commons.codec.digest{code}
with this:
{code:java}
org.apache.commons.codec;resolution:=optional,org.apache.commons.codec.digest;resolution:=optional{code}
 

 

I almost have a PR ready for this change, I guess I'll be able to submit it by 
tomorrow.

 

Regarding the "org.apache.commons.commons-codec;resolution:=optional" line: I 
don't really understand what it means and what it references, since such a 
package doesnt exist as far as I know. It doesn't hurt us though, since it's 
optional anyways and I don't understand the implications of removing it. So if 
it was my decision, I'd just leave it in there.

> OSGi Manifest requires optional dependency commons-codec
> --------------------------------------------------------
>
>                 Key: COMPRESS-660
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-660
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Build
>    Affects Versions: 1.26.0
>            Reporter: Christoph Loy
>            Priority: Major
>
> Since version 1.26, commons-compress *optionally* [requires 
> commons-codec|https://github.com/apache/commons-compress/blob/09a271dfd73e3ce01815f3f65057f92b5b7009bb/pom.xml#L134].
> In the OSGi-Manifest, the Import-Package declaration for 
> org.apache.commons.codec does not have the resolution:=optional attribute.
>  
> In our case, we have commons-compress as maven dependency. Since 
> commons-codec is an optional dependency, it is not downloaded automatically. 
> But when we start our application, we get an OSGi error that commons-codec 
> cannot be resolved.
>  
>  
> To fix this issue, the Import-Package delcaration to all 
> apache.commons.compress packages has to be marked with resolution:=optional 
> in META-INF/MANIFEST.MF.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to