Hi all,
I finally managed to convert a shaded jar into an OSGi, bundle, but it was a lot trickier than I thought:
- Adding a BundleTaskConvention to the shadowJar task had no effect.
- The Bundle task expects its inputs to be a set of files, and not a jar.
- The classes in sourceSet.main.output have not been shaded yet and so are unsuitable for bundling.
I resolved this by feeding Bundle with
shadowJar.map { zipTree(it.archiveFile) }
but even so, the contents of the original shadowJar MANIFEST.MF were all lost. How do people typically package shaded jars as OSGi bundles please? Is there an existing pattern or Gradle task to do this? Or do people simply not do this kind of thing any more?
Thanks,
Chris