If you already have a Manifest file generated, you're going to have to configure the jar task's manifest file given the existing one. I'm not entirely sure about the best way to do that.
What's your purpose in including the Apache-Commons JAR file within your generated JAR? You can, of course, add the JAR file itself into your JAR by adding the JAR into the resources source set, but unless I'm mistaken, the classloader won't know how to load classes from that internal JAR. The other option is to create a fat jar by merging the other jar and your generated jar. That can cause problems with licensing, if you're not careful. ~~ Robert. On 8 October 2010 15:33, Alessandro Novarini <[email protected]>wrote: > Hi all, > Reading both gradle and bnd documentation didn't help me to find > answers to the following questions, I hope you can turn the light on > and make me see the truth on the OSGI plugin: > > Instructing properly the plugin > The gradle documentation says: "The classes in the classes dir are > analyzed regarding there package dependencies and the packages they > expose. Based on this the Import-Package and the Export-Package values > of the OSGi Manifest are calculated." > > I can't understand what I have to do in this situation, because > neither Import-Package nor Export-Package instructions are included in > the generated manifest file. > So, how does the plugin know which are the packages to be imported and > which are the ones to export? > > Private Package instruction > In the example 26.2 of the gradle documentation the instruction > 'Private-Package" has a list of packages explicitly written. > In my example I want to make private the package org.apache.commons.*, > so that in the manifest file I'll see org.apache.commons.beanutils, > org.apache.commons.beanutils.converters etc. etc. > The wildcard * doesn't expand the package list, all I see in the > manifest is the string org.apache.commons.*. Is there a way to achieve > this goal? > > Including dependencies > Continuing with the example above, is there a way to include the jar > of apache-commons in my jar using some feature of the plugin? Or > should I add in some way scripting my build? > > All these questions came out because I already have a manifest file of > this project generated by the maven plugin (that uses bnd as well), > and I would like to reproduce the exact output using gradle, but I'm > far from the expected. > > Thank you in advance > Ale > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > >
