I am trying to ensure my bundle is not going to fail because the commons stuff I am using (httpclient) requires JCL. I don't use it myself but if it is not there then things just fail so I have to include it in my bundle. I would prefer to have the bundle work even if the OSGi it is deployed into has no logging service so I set it up to export JCL and log4j and also import them. Does this seem like an OK way to handle things? Any pointers would be appreciated. Thanks!
>From the pom (attached): <!-- logging --> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </dependency> </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.*,org.sakaiproject.eb.osgi.util.*,org.apache.commons.logging,org.apache.log4j,</Export-Package> <Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency> <Embed-Transitive>true</Embed-Transitive> <!-- logging adds !org.apache.log,!org.apache.avalon.*,!com.sun.*,!org.w3c.dom, --> <Import-Package>!org.apache.commons.beanutils.*,!javax.*,!org.xml.*,!org.apache.log,!org.apache.avalon.*,!com.sun.*,!org.w3c.dom,,org.apache.commons.logging,org.apache.log4j,*</Import-Package> </instructions> </configuration> </plugin> And then the mannifest looks sorta like this: Import-Package: org.apache.commons.logging,org.apache.log4j,org.osgi.f ramework;version="1.3",org.osgi.util.tracker;version="1.3",org.sakaip ...(snip) Embed-Transitive: true Bnd-LastModified: 1239616629144 Export-Package: org.sakaiproject.entitybus.entityprovider.extension;us es:="org.sakaiproject.entitybus,org.sakaiproject.entitybus.entityprov ...(snip) us.providers",org.sakaiproject.entitybus.event,org.sakaiproject.eb.os gi.util;uses:="org.osgi.framework,org.osgi.util.tracker",org.apache.c ommons.logging,org.apache.log4j Bundle-Version: 0.9.0.SNAPSHOT Ignore-Package: org.apache.commons.beanutils,javax.swing.text,org.xml. ...(snip) Bundle-Name: EntityBroker OSGi Services Bundle-ClassPath: .,commons-logging-1.1.1.jar,reflectutils-0.9.10.jar, entitybus-impl-1.0.3.jar,commons-httpclient-3.1.jar,servlet-api-2.4.j ar,entitybus-api-1.0.3.jar,commons-codec-1.2.jar,log4j-1.2.14.jar,ent itybus-utils-1.0.3.jar -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> </dependency> <dependency> <groupId>org.sakaiproject.entitybus</groupId> <artifactId>entitybus-utils</artifactId> <scope>compile</scope> </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> <!-- logging --> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </dependency> </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.*,org.sakaiproject.eb.osgi.util.*,org.apache.commons.logging,org.apache.log4j,</Export-Package> <Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency> <Embed-Transitive>true</Embed-Transitive> <!-- logging adds !org.apache.log,!org.apache.avalon.*,!com.sun.*,!org.w3c.dom, --> <Import-Package>!org.apache.commons.beanutils.*,!javax.*,!org.xml.*,!org.apache.log,!org.apache.avalon.*,!com.sun.*,!org.w3c.dom,org.apache.commons.logging,org.apache.log4j,*</Import-Package> </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