You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Pascal Kesseli <pa...@hotmail.com> on 2010/03/12 18:29:13 UTC

mess

Hi everyone

Using the following configuration:

<configuration>
	<unpackBundle>true</unpackBundle>
	<manifestLocation>META-INF</manifestLocation>
	<instructions>
	
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
		<Bundle-Version>${project.version}</Bundle-Version>
	
<Bundle-RequiredExecutionEnvironment>JavaSE-1.6</Bundle-RequiredExecutionEnv
ironment>
		<Bundle-ClassPath>.,{maven-dependencies}</Bundle-ClassPath>
	
<Export-Package>!ch.hsr.ifs.flexclipse.resources.*,ch.hsr.ifs.flexclipse.*;v
ersion="${project.version}"</Export-Package>
	
<Private-Package>ch.hsr.ifs.flexclipse.resources.*</Private-Package>
	
<Bundle-Activator>ch.hsr.ifs.flexclipse.Activator</Bundle-Activator>
	
<Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency>
		<Embed-Directory>dependency</Embed-Directory>
		<Embed-StripGroup>false</Embed-StripGroup>
		<Embed-Transitive>true</Embed-Transitive>
	</instructions>
</configuration>

And these dependencies:

<dependencies>
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring</artifactId>
		<version>2.5.6</version>
	</dependency>
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-aspects</artifactId>
		<version>2.5.6</version>
	</dependency>
	<dependency>
		<groupId>org.eclipse.swt.win32.win32</groupId>
		<artifactId>x86</artifactId>
		<version>3.6.0</version>
		<type>jar</type>
		<scope>provided</scope>
	</dependency>
	<dependency>
		<groupId>org.eclipse.ui</groupId>
		<artifactId>ide</artifactId>
		<version>3.6.0</version>
		<type>jar</type>
		<scope>provided</scope>
	</dependency>
	<dependency>
		<groupId>org.eclipse.ui</groupId>
		<artifactId>console</artifactId>
		<version>3.5.0</version>
		<type>jar</type>
		<scope>provided</scope>
	</dependency>
	<dependency>
		<groupId>org.eclipse.cdt</groupId>
		<artifactId>core</artifactId>
		<version>5.2.0</version>
		<scope>provided</scope>
	</dependency>
</dependencies>

I get the following Import-Package declaration in my MANIFEST.MF:

Import-Package: bsh,ch.hsr.ifs.flexclipse;version="0.0",ch.hsr.ifs.fle
 xclipse.config;version="0.0",ch.hsr.ifs.flexclipse.contributions;vers
 ion="0.0",ch.hsr.ifs.flexclipse.dialogs;version="0.0",ch.hsr.ifs.flex
 clipse.handlers;version="0.0",ch.hsr.ifs.flexclipse.marker;version="0
 .0",ch.hsr.ifs.flexclipse.model;version="0.0",ch.hsr.ifs.flexclipse.p
 arser;version="0.0",ch.hsr.ifs.flexclipse.persistance;version="0.0",c
 h.hsr.ifs.flexclipse.quickfixes;version="0.0",ch.hsr.ifs.flexclipse.v
 iews;version="0.0",com.bea.jvm,com.caucho.burlap.client,com.caucho.bu
 rlap.io,com.caucho.burlap.server,com.caucho.hessian.client,com.caucho
 .hessian.io,com.caucho.hessian.server,com.ibatis.common.util,com.ibat
 is.common.xml,com.ibatis.sqlmap.client,com.ibatis.sqlmap.client.event
 ,com.ibatis.sqlmap.engine.builder.xml,com.ibatis.sqlmap.engine.impl,c
 om.ibatis.sqlmap.engine.transaction,com.ibatis.sqlmap.engine.transact
 ion.external,com.ibatis.sqlmap.engine.type,com.ibm.wsspi.uow,com.jamo
 napi,com.mchange.v2.c3p0,com.sun.enterprise.loader,com.sun.net.httpse
 rver,com.sun.rowset,commonj.timers,commonj.work,edu.emory.mathcs.back
 port.java.util.concurrent,freemarker.cache,freemarker.template,groovy
 .lang,javax.activation,javax.annotation,javax.ejb,javax.el,javax.face
 s.application,javax.faces.context,javax.faces.el,javax.faces.event,ja
 vax.interceptor,javax.jdo,javax.jdo.datastore,javax.jms,javax.jws,jav
 ax.mail,javax.mail.internet,javax.management,javax.management.modelmb
 ean,javax.management.openmbean,javax.management.remote,javax.naming,j
 avax.persistence,javax.persistence.spi,javax.resource,javax.resource.
 cci,javax.resource.spi,javax.resource.spi.endpoint,javax.resource.spi
 .work,javax.rmi,javax.rmi.CORBA,javax.servlet,javax.servlet.http,java
 x.servlet.jsp,javax.servlet.jsp.el,javax.servlet.jsp.tagext,javax.sql
 ,javax.sql.rowset,javax.transaction,javax.transaction.xa,javax.xml.na
 mespace,javax.xml.parsers,javax.xml.rpc,javax.xml.rpc.encoding,javax.
 xml.rpc.server,javax.xml.rpc.soap,javax.xml.soap,javax.xml.transform,
 javax.xml.transform.dom,javax.xml.ws,javax.xml.ws.handler,javax.xml.w
 s.soap,net.sf.cglib.asm,net.sf.cglib.core,net.sf.cglib.proxy,net.sf.c
 glib.transform.impl,net.sf.ehcache,net.sf.ehcache.bootstrap,net.sf.eh
 cache.constructs.blocking,net.sf.ehcache.event,net.sf.ehcache.store,n
 et.sf.jasperreports.engine,net.sf.jasperreports.engine.data,net.sf.ja
 sperreports.engine.export,oracle.classloader.util,oracle.toplink.esse
 ntials.ejb.cmp3,oracle.toplink.essentials.internal.databaseaccess,ora
 cle.toplink.essentials.internal.sessions,oracle.toplink.essentials.se
 ssions,oracle.toplink.exceptions,oracle.toplink.expressions,oracle.to
 plink.internal.databaseaccess,oracle.toplink.jndi,oracle.toplink.logg
 ing,oracle.toplink.publicinterface,oracle.toplink.queryframework,orac
 le.toplink.sessionbroker,oracle.toplink.sessions,oracle.toplink.three
 tier,oracle.toplink.tools.sessionconfiguration,oracle.toplink.tools.s
 essionmanagement,org.apache.avalon.framework.logger,org.apache.axis.e
 ncoding.ser,org.apache.catalina.loader,org.apache.commons.attributes,
 org.apache.commons.collections,org.apache.commons.collections.map,org
 .apache.commons.httpclient,org.apache.commons.httpclient.methods,org.
 apache.commons.httpclient.params,org.apache.commons.pool,org.apache.c
 ommons.pool.impl,org.apache.log,org.apache.log4j,org.apache.log4j.xml
 ,org.apache.openjpa.persistence,org.apache.taglibs.standard.lang.supp
 ort,org.apache.velocity,org.apache.velocity.app,org.apache.velocity.c
 ontext,org.apache.velocity.exception,org.apache.velocity.runtime,org.
 apache.velocity.runtime.log,org.apache.velocity.runtime.resource,org.
 apache.velocity.runtime.resource.loader,org.codehaus.groovy.control,o
 rg.eclipse.cdt.core.model,org.eclipse.cdt.core.settings.model,org.ecl
 ipse.core.commands,org.eclipse.core.commands.common,org.eclipse.core.
 expressions,org.eclipse.core.internal.resources,org.eclipse.core.reso
 urces,org.eclipse.core.runtime;registry=split;version="3.4",org.eclip
 se.jface.action,org.eclipse.jface.dialogs,org.eclipse.jface.text;text
 =split,org.eclipse.jface.viewers,org.eclipse.osgi.service.datalocatio
 n;version="1.3",org.eclipse.persistence.internal.databaseaccess,org.e
 clipse.persistence.internal.sessions,org.eclipse.persistence.jpa,org.
 eclipse.persistence.sessions,org.eclipse.swt.events,org.eclipse.swt.g
 raphics,org.eclipse.swt.layout,org.eclipse.swt.widgets,org.eclipse.ui
 ;ui.workbench=split,org.eclipse.ui.handlers,org.eclipse.ui.ide,org.ec
 lipse.ui.part;ui.workbench=split,org.eclipse.ui.plugin,org.eclipse.ui
 .texteditor;texteditor=split,org.enhydra.jdbc.core,org.hibernate,org.
 hibernate.cache,org.hibernate.cfg,org.hibernate.classic,org.hibernate
 .connection,org.hibernate.context,org.hibernate.criterion,org.hiberna
 te.dialect,org.hibernate.ejb,org.hibernate.engine,org.hibernate.event
 ,org.hibernate.event.def,org.hibernate.exception,org.hibernate.impl,o
 rg.hibernate.jdbc,org.hibernate.persister.entity,org.hibernate.tool.h
 bm2ddl,org.hibernate.transaction,org.hibernate.transform,org.hibernat
 e.type,org.hibernate.usertype,org.hibernate.util,org.jruby,org.jruby.
 ast,org.jruby.exceptions,org.jruby.javasupport,org.jruby.runtime,org.
 jruby.runtime.builtin,org.objectweb.jotm,org.omg.CORBA,org.omg.CORBA.
 portable,org.omg.CORBA_2_3.portable,org.osgi.framework;version="1.5",
 org.quartz,org.quartz.impl,org.quartz.impl.jdbcjobstore,org.quartz.si
 mpl,org.quartz.spi,org.quartz.utils,org.quartz.xml,org.springframewor
 k.instrument,org.w3c.dom,org.xml.sax,org.xml.sax.helpers

I wouldn't actually mind at all, if there weren't these imports like bsh or
com.caucho.burlap.client that are not available in any of the dependencies
jars and thus cause my build to fail. I would have actually expected much
more spring packages to be imported, instead all the other random packages
get on the list. What is going on here? What am I missing?

Thanks for any recommendations and best regards
Pascal



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: mess

Posted by Stuart McCulloch <mc...@gmail.com>.
On 13 March 2010 16:31, Pascal Kesseli <pa...@hotmail.com> wrote:

> Are you telling me that I can't use Spring with maven-bundle-plugin? That
> seems a bit cheap. What separates Spring so much from other libraries -
> except that it has quite the dependency list?
>

I think Justin meant why are you embedding Spring when it's already
available as a bundle, and you can map Spring beans to components
in OSGi using Spring-DM: http://www.springsource.org/osgi

Back to the original question - you are getting a lot of imports because
certain Spring artifacts have a lot of transitive dependencies. Let's look
at your Embed-Dependency instruction:

   <Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency>
   <Embed-Transitive>true</Embed-Transitive>

Here you're asking the bundleplugin to embed all dependencies from the
Maven classpath that have either compile or runtime scope. You're also
asking it to consider transitive dependencies. Looking at your pom this
is the main Spring artifact and the aspects jar.

For Spring this probably ends up being a lot of artifacts - you can easily
check this by using "jar tvf <file>" or "unzip -l <file>" to see what's in
the
final bundle. These will be the artifacts from the entire Spring dependency
tree that had compile or runtime scope.

However this won't include any dependencies that had provided scope,
because that's not one of the scope values used in your embed filter.

The Bnd tool will automatically add imports when it finds bytecode in
the final bundle that refers to a package, and that package is not part
of the final bundle. So your large import list is because you embed a
lot of jars that refer to packages in other dependencies with provided
scope.

For example you might find you're embedding some Spring database
artifacts, but not the actual database driver artifacts - hence you'll get
imports for all the referenced (but missing) database packages.

If you know you don't use certain packages at runtime you can tell Bnd
to ignore them by adding a negative entry to Import-Package like so:

  <Import-Package>!javax.*, *</Import-Package>

(the trailing wildcard is so Bnd still adds the other packages to the list)

But given Spring already provides bundles, it will be much easier to use
them directly than try to embed Spring yourself and deal with the mess.

HTH


>
> -----Ursprüngliche Nachricht-----
> Von: Justin Edelson [mailto:justinedelson@gmail.com]
> Gesendet: Freitag, 12. März 2010 19:38
> An: users@felix.apache.org
> Betreff: Re: <Embed-Dependency> mess
>
> On 3/12/10 12:29 PM, Pascal Kesseli wrote:
> > What is going on here? What am I missing?
>
> In brief... don't embed Spring.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
> Eingehende eMail ist virenfrei.
> Von AVG überprüft - www.avg.de
> Version: 8.5.436 / Virendatenbank: 271.1.1/2741 - Ausgabedatum: 03/12/10
> 09:42:00
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

-- 
Cheers, Stuart

Re: mess

Posted by Justin Edelson <ju...@gmail.com>.
No. You obviously CAN embed it; I just said you shouldn't. In general,
embedding should only be used in cases where a library isn't provided
as an OSGi bundle. Spring provides bundles, therefore you have no need
to embed it.

And if you do embed a library with broad dependencies, be prepared to
tune the import list.

Justin



On Mar 13, 2010, at 3:31 AM, Pascal Kesseli
<pa...@hotmail.com> wrote:

> Are you telling me that I can't use Spring with maven-bundle-plugin?
> That
> seems a bit cheap. What separates Spring so much from other
> libraries -
> except that it has quite the dependency list?
>
>
> -----Ursprüngliche Nachricht-----
> Von: Justin Edelson [mailto:justinedelson@gmail.com]
> Gesendet: Freitag, 12. März 2010 19:38
> An: users@felix.apache.org
> Betreff: Re: <Embed-Dependency> mess
>
> On 3/12/10 12:29 PM, Pascal Kesseli wrote:
>> What is going on here? What am I missing?
>
> In brief... don't embed Spring.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
> Eingehende eMail ist virenfrei.
> Von AVG überprüft - www.avg.de
> Version: 8.5.436 / Virendatenbank: 271.1.1/2741 - Ausgabedatum:
> 03/12/10
> 09:42:00
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: mess

Posted by Pascal Kesseli <pa...@hotmail.com>.
Are you telling me that I can't use Spring with maven-bundle-plugin? That
seems a bit cheap. What separates Spring so much from other libraries -
except that it has quite the dependency list?


-----Ursprüngliche Nachricht-----
Von: Justin Edelson [mailto:justinedelson@gmail.com] 
Gesendet: Freitag, 12. März 2010 19:38
An: users@felix.apache.org
Betreff: Re: <Embed-Dependency> mess

On 3/12/10 12:29 PM, Pascal Kesseli wrote:
> What is going on here? What am I missing?

In brief... don't embed Spring.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Eingehende eMail ist virenfrei.
Von AVG überprüft - www.avg.de 
Version: 8.5.436 / Virendatenbank: 271.1.1/2741 - Ausgabedatum: 03/12/10
09:42:00 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: mess

Posted by Justin Edelson <ju...@gmail.com>.
On 3/12/10 12:29 PM, Pascal Kesseli wrote:
> What is going on here? What am I missing?

In brief... don't embed Spring.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org