2009/1/28 Vinicius Carvalho <[email protected]> > Yeah, my bad sorry :) > > This bundle is fine, now I'm building the graph bundle, which requires some > internal depenencies (I was doing this by hand by adding them to the jar > and > then using the Bundle-ClassPath). Well I used the <Embed-Dependencies> tag, > it does embed all the dependencies but it generates a lot of > private-packages . Just would like to know if they are really necessary? >
the Private-Package list is additional metadata that Bnd uses to tell you what packages it kept as private - you don't need to keep this metadata in the final bundle. Include-Resource is another informational entry that you don't need to keep around (except for debugging your build) to remove both of these entries you can use: <_removeheaders>Include-Resource,Private-Package</_removeheaders> or if you're using a property file to configure the Bnd instructions: -removeheaders: Include-Resource,Private-Package see http://aqute.biz/Code/Bnd (referenced from the bundleplugin docs) I've seen that one can use the <_exportcontents> would this be solution? > _exportcontents is explained on the Bnd site, as well as here: http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html it basically acts like Export-Package but doesn't change what's pulled into your final bundle (whereas Export-Package will pull in the listed packages directly into your bundle, regardless of whether they're already embedded) so if you embedded a Jar and used Export-Package you'd end up with two copies of these classes (ie. one embedded, and one pulled in and inlined) Using exportcontents just means you can export packages from embedded Jars without pulling in duplicate classes - it shouldn't affect Private-Package Regards > > Manifest-Version: 1.0 > Export-Package: org.openspotlight.graph;uses:="javax.xml.transform,jav > ax.xml.transform.dom,org.w3c.dom" > Private-Package: org.openspotlight.graph.elements,edu.uci.ics.jung.gra > ph.event,org.apache.commons.collections15.set,org.openspotlight.graph > .exceptions,org.apache.commons.beanutils.expression,com.sun.xml.bind. > util,cern.colt.list.adapter,com.sun.xml.bind.v2.runtime.unmarshaller, > org.apache.commons.beanutils.locale.converters,com.sun.xml.bind.v2.ru > ntime,org.apache.commons.beanutils.converters,cern.jet.random.samplin > g,com.sun.xml.bind.v2.model.runtime,org.apache.commons.collections15. > collection,hep.aida.bin,com.sun.xml.bind.v2.model.impl,com.sun.xml.bi > nd,javax.xml.bind.util,com.sun.xml.bind.v2.bytecode,cern.colt,com.sun > .xml.bind.v2.model.annotation,corejava,com.sun.xml.bind.unmarshaller, > cern.colt.matrix.doublealgo,hep.aida.ref,org.apache.commons.collectio > ns15.functors,edu.uci.ics.jung.graph.util,org.openspotlight.graph.uti > l,com.sun.xml.bind.api,com.sun.xml.txw2.output,cern.jet.stat.quantile > ,com.sun.xml.bind.v2.schemagen.episode,javax.xml.bind.attachment,org. > apache.commons.collections15.list,net.jcip.annotations,cern.colt.func > tion,javax.xml.bind.annotation,com.sun.xml.bind.annotation,com.sun.xm > l.bind.v2.runtime.reflect,org.openspotlight.graph.predicates,edu.uci. > ics.jung.graph,org.apache.commons.beanutils.locale,cern.colt.map,cern > .colt.matrix.bench,com.sun.istack.localization,org.apache.commons.bea > nutils,com.sun.istack,com.sun.xml.bind.api.impl,cern.clhep,org.apache > .commons.collections,org.apache.commons.collections15.buffer,cern.jet > .stat,com.sun.xml.bind.v2.model.nav,org.apache.commons.collections15. > keyvalue,com.sun.xml.bind.v2.runtime.property,cern.colt.bitvector,com > .sun.xml.txw2.annotation,cern.jet.math,javax.xml.bind.helpers,cern.co > lt.matrix,hep.aida,cern.colt.list,cern.colt.buffer,com.sun.xml.bind.v > 2.runtime.output,org.apache.commons.collections15.bag,cern.jet.random > ,cern.jet.random.engine,com.sun.xml.bind.v2.schemagen,com.sun.xml.bin > d.v2.util,cern.colt.matrix.objectalgo,javax.xml.bind.annotation.adapt > ers,com.sun.xml.bind.v2.runtime.reflect.opt,com.sun.xml.bind.v2.model > .core,org.apache.commons.collections15.map,com.sun.xml.txw2,com.sun.x > ml.bind.v2.schemagen.xmlschema,org.apache.commons.collections15.compa > rators,org.apache.commons.collections15.iterators,org.apache.commons. > collections15.bidimap,com.sun.xml.bind.marshaller,com.sun.xml.bind.v2 > ,cern.colt.matrix.linalg,cern.colt.matrix.impl,org.apache.commons.col > lections15,javax.xml.bind,org.apache.commons.collections15.multimap > Bundle-ClassPath: .,commons-beanutils-core-1.8.0.jar,graph-2.0-beta1.j > ar,jaxb-api-2.1.jar,colt-1.2.0.jar,collections-generic-4.01.jar,jaxb- > impl-2.1.9.jar,jcip-annotations-1.0.jar,api-2.0-beta1.jar > Built-By: viniciuscarvalho > Tool: Bnd-0.0.295 > Bundle-Name: SpotLight :: Graph > Created-By: Apache Maven Bundle Plugin > Bundle-Vendor: Caravela > Build-Jdk: 1.6.0_07 > Bundle-Version: 0.0.1.SNAPSHOT > Bnd-LastModified: 1233076965413 > Bundle-ManifestVersion: 2 > Bundle-License: http://www.gnu.org/licenses/lgpl-2.1.html > Bundle-DocURL: http://www.caravelatech.com/ > Import-Package <http://www.caravelatech.com/Import-Package>: > EDU.oswego.cs.dl.util.concurrent,com.sun.xml.fastinfos > et.sax,com.sun.xml.fastinfoset.stax,javax.activation,javax.imageio,ja > vax.imageio.stream,javax.xml.datatype,javax.xml.namespace,javax.xml.p > arsers,javax.xml.stream,javax.xml.stream.events,javax.xml.transform,j > avax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.st > ream,javax.xml.validation,org.apache.commons.logging,org.jvnet.fastin > foset,org.jvnet.staxex,org.openspotlight.graph,org.w3c.dom,org.xml.sa > x,org.xml.sax.ext,org.xml.sax.helpers > Embed-Dependency: * > Bundle-SymbolicName: org.openspotlight.spotlight-graph > > On Tue, Jan 27, 2009 at 3:19 PM, Guillaume Sauthier < > [email protected]> wrote: > > > In fact, you telled Bnd that you only wanted to import the package > > 'org.openspotlight.graph', So Bnd do what you ask it to do :) > > I think that you expect Bnd to: > > * Import manually the 'org.openspotlight.graph' package (for some reason, > > you added it here because Bnd cannot discover it by itself ?) > > * And still contiue to import all other referenced classes > > > > The working statement is : > > > > <Import-Package> > > org.openspotlight.graph,* > > </Import-Package> > > > > Notice the final '*' > > > > Cheers > > --Guillaume > > > > > > > > > > Vinicius Carvalho a écrit : > > > > Really? I tough it would do it for my by inspecting my import statements > on > > my classes? > > > > On Tue, Jan 27, 2009 at 12:01 PM, Martin Thelian <[email protected]> > <[email protected]>wrote: > > > > > > > > You need to add import statements for "org.osgi.framework" and > > "org.osgi.util.tracker" into the Import-Package tag, e.g. > > > > > > > > <Import-Package> > > org.openspotlight.graph, > > org.osgi.framework, > > org.osgi.util.tracker > > </Import-Package> > > > > > > > > Regards, > > Martin > > > > > > Vinicius Carvalho schrieb: > > > > Hello there! I've assembled my project using the maven bundle plugin, > but > > > > > > when I run the bundle goal, I get an exception: > > > > --- > > [INFO] Building parsers-api > > [INFO] task-segment: [org.apache.felix:maven-bundle-plugin:bundle] > > [INFO] > > > > > ---------------------------------------------------------------------------- > > [INFO] [bundle:bundle] > > [ERROR] Error building bundle > > org.openspotlight:parsers-api:bundle:0.0.1-SNAPSHOT : Unresolved > > references > > to [org.osgi.framework, org.osgi.util.tracker] by class(es) on the > > Bundle-Classpath[Jar:dot]: > > [org/openspotlight/parsers/internal/Activator.class, > > org/openspotlight/parsers/internal/ParserTracker.class] > > [ERROR] Error(s) found in bundle configuration > > [INFO] > > ------------------------------------------------------------------------ > > [ERROR] BUILD ERROR > > [INFO] > > ------------------------------------------------------------------------ > > [INFO] Error(s) found in bundle configuration > > > > [INFO] > > ------------------------------------------------------------------------ > > [INFO] For more information, run Maven with the -e switch > > [INFO] > > ------------------------------------------------------------------------ > > [INFO] Total time: 1 second > > [INFO] Finished at: Tue Jan 27 10:58:29 BRST 2009 > > [INFO] Final Memory: 10M/23M > > [INFO] > > ------------------------------------------------------------------------ > > Here's my pom.xml > > > > <project xmlns="http://maven.apache.org/POM/4.0.0" < > http://maven.apache.org/POM/4.0.0> xmlns:xsi=" > > http://www.w3.org/2001/XMLSchema-instance" < > http://www.w3.org/2001/XMLSchema-instance> > > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > > http://maven.apache.org/maven-v4_0_0.xsd" < > http://maven.apache.org/POM/4.0.0http://maven.apache.org/maven-v4_0_0.xsd > >> > > <modelVersion>4.0.0</modelVersion> > > <groupId>org.openspotlight</groupId> > > <artifactId>parsers-api</artifactId> > > <packaging>bundle</packaging> > > <version>0.0.1-SNAPSHOT</version> > > <name>parsers-api</name> > > <url>http://maven.apache.org</url> > > <dependencies> > > <dependency> > > <groupId>junit</groupId> > > <artifactId>junit</artifactId> > > <version>3.8.1</version> > > <scope>test</scope> > > </dependency> > > <dependency> > > <groupId>org.apache.felix</groupId> > > <artifactId>org.osgi.core</artifactId> > > <version>1.2.0</version> > > </dependency> > > <dependency> > > <groupId>org.apache.felix</groupId> > > <artifactId>org.osgi.compendium</artifactId> > > <version>1.2.0</version> > > </dependency> > > </dependencies> > > <build> > > <plugins> > > <plugin> > > <groupId>org.apache.felix</groupId> > > <artifactId>maven-bundle-plugin</artifactId> > > <extensions>true</extensions> > > <configuration> > > <instructions> > > > > <Export-Package>org.openspotlight.parsers</Export-Package> > > > > <Import-Package>org.openspotlight.graph</Import-Package> > > > > <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName> > > > > <Private-Package>org.openspotlight.parsers.*</Private-Package> > > </instructions> > > </configuration> > > </plugin> > > </plugins> > > </build> > > > > </project> > > > > I've followed the instructions at felix site documentation. > > > > Regards > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > -- Cheers, Stuart

