I am having trouble getting my Import-Package down to a reasonable size. It currently pulls in a huge number of things (based on bytecode scanning from what I understand). I think there may be 3 things I am doing wrong here but I cannot seem to find the answers so I am asking here instead. I attached the pom and the generated manifest for reference:
1) Somehow I am getting duplicates of my exported packages in my imports. I am exporting this stuff (org.sakaiproject.entitybus.*) For Example: Import-Package: javax.crypto,javax.crypto.spec,javax.net,javax.net.ssl ,javax.xml.parsers,org.apache.avalon.framework.logger,org.apache.comm ons.beanutils,org.apache.log,org.apache.log4j,org.osgi.framework;vers ion="1.3",org.osgi.util.tracker;version="1.3",org.sakaiproject.entity bus,org.sakaiproject.entitybus.access,org.sakaiproject.entitybus.coll ... (snip) ... Embed-Transitive: true Bnd-LastModified: 1239373356766 Export-Package: org.sakaiproject.entitybus.entityprovider.annotations, org.sakaiproject.entitybus.entityprovider.capabilities;uses:="org.sak aiproject.entitybus.entityprovider.extension,org.sakaiproject.entityb us.entityprovider,org.sakaiproject.entitybus,org.sakaiproject.entityb us.entityprovider.search,org.sakaiproject.entitybus.access",org.sakai ... (snip) ... Here is the relelvant section of the pom: <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> <configuration> <instructions> <Bundle-Activator>org.sakaiproject.eb.osgi.EBActivator</Bundle-Activator> <Export-Package>!org.sakaiproject.entitybus.impl.*,!org.sakaiproject.entitybus.util.*,org.sakaiproject.entitybus.*</Export-Package> <Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency> <Embed-Transitive>true</Embed-Transitive> </instructions> </configuration> 2) I am getting a bunch of javax.*, org.apache.*, and org.xml.* dependencies in the import of the manifest. Most of these are because I need httputils and the servlet api (which are the only actual dependencies I have that are not my own stuff) but I am not sure why the relelvant stuff is not being included since these are transitive dependencies and I have embed-transitive set to true. I am hoping someone has pulled in the servlet api or commons-httpclient before and knows how to deal with this. (see the attached pom/manifest) 3) Is there way to correctly handle the servlet stuff? I know about http.service but I don't really want to pack the servlet api into my bundle because that does not work, but removing it causes the bundle to fail so I am guessing I need to somehow fix my dependencies in the pom so that it correctly creates the imports. Using provided seems to correct the build failure issue but then it fails to resolve at runtime so I am stuck. 4) Is there a reference somewhere that explains how the changes in the dependencies affect the import/export/private values in the manifest? I figured out that excluding packages can keep them from ending up in the import and priivate area but this only works if they are actual transitive dependencies somewhere in the chain. For things which I am not quite sure where they are coming from (like the org.xml.sax one) I don't know how to control it. A RTFM with a link would be totally great here. Thanks for any help -AZ -- Aaron Zeckoski (aar...@vt.edu) Senior Research Engineer - CARET - Cambridge University [http://bugs.sakaiproject.org/confluence/display/~aaronz/] Sakai Fellow - [http://aaronz-sakai.blogspot.com/]
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="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"> <modelVersion>4.0.0</modelVersion> <name>EntityBroker OSGi Services</name> <groupId>org.sakaiproject.osgi.eb</groupId> <artifactId>eb-services</artifactId> <packaging>bundle</packaging> <parent> <groupId>org.sakaiproject.osgi</groupId> <artifactId>eb</artifactId> <version>0.9-SNAPSHOT</version><!--eb-osgi.version--> </parent> <dependencies> <!-- internal deps --> <dependency> <groupId>org.sakaiproject.entitybus</groupId> <artifactId>entitybus-api</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>org.sakaiproject.entitybus</groupId> <artifactId>entitybus-impl</artifactId> <scope>compile</scope> <exclusions> <exclusion> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.sakaiproject.entitybus</groupId> <artifactId>entitybus-utils</artifactId> <scope>compile</scope> <exclusions> <exclusion> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> </exclusion> </exclusions> </dependency> <!-- Common --> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <scope>compile</scope> </dependency> <!-- OSGi --> <dependency> <groupId>org.osgi</groupId> <artifactId>osgi_R4_core</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.osgi</groupId> <artifactId>osgi_R4_compendium</artifactId> <scope>provided</scope> </dependency> <!-- Sakai --> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> <configuration> <instructions> <Bundle-Activator>org.sakaiproject.eb.osgi.EBActivator</Bundle-Activator> <Export-Package>!org.sakaiproject.entitybus.impl.*,!org.sakaiproject.entitybus.util.*,org.sakaiproject.entitybus.*</Export-Package> <Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency> <Embed-Transitive>true</Embed-Transitive> </instructions> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <inherited>true</inherited> <configuration> <useFile>false</useFile> <redirectTestOutputToFile>false</redirectTestOutputToFile> <trimStackTrace>false</trimStackTrace> </configuration> </plugin> </plugins> </build> </project>
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@felix.apache.org For additional commands, e-mail: users-h...@felix.apache.org