Closed nvamelichev closed 9 years ago
Yes, the bundle-plugin is configured in a way to embed commons-compress into the resulting jarchivelib bundle. This is not a clean solution and was done for convenience reasons, because commons-compress is not OSGi compatible, there is no wrapper bundle of the current version of commons-compress, (that I know of 1,2), and neither is the dependency org.tukaani.xz
.
A clean solution would be to build (or find) wrapper bundles for both of these and provide an OSGi features file s.t. jarchivelib can be conveniently installed to an OSGi container without knowing transitive dependencies. Then the Embed-Dependency
declaration can be removed. A menial task I have been avoiding :-)
I can't think of a workaround until then at the top of my head.
Turns out I'm totally wrong. commons-compress actually IS OSGi compatible. I'll release the fix with 0.6.2
commons-compress
seems to have some OSGI support, but org.tukaani.xz
does not (see COMPRESS-199). It looks like the "super-clean" solution would require adding OSGI support to xz library.
thanks for pointing it out. 0.6.2 should be on central in a few hours.
Thank you! :-)
org.rauschig:jarchivelib:jar:0.6.1
maven artifact simultaneously depends on and containsorg.apache.commons:commons-compress:jar:1.8
(you can see this here, in the "Packages" section).If
maven-enforcer-plugin
is configured withBanDuplicateClasses
rule, plain Java (non-OSGI) projects depending onjarchivelib
will fail to build:Looks like this had been done to package
jarchivelib
as an OSGI bundle. UsingImport-Package: org.apache.commons.compress.*;version=1.8
instead ofEmbed-Dependency
will probably solve this problem and will ensure that the users can add dependency on externally-packagedcommons-compress
bundle, e.g. from Eclipse Orbit. See this stackoverflow question for a similar solution.