2008/7/8 Alexandre Sauvé <[EMAIL PROTECTED]>:

> Hey gang,
>
> I was reading the thread between Stuart and Fabio (
> http://www.mail-archive.com/[email protected]/msg00896.html)
> regarding
> Maven Bundle and Eclipse RCP and I have read the documentation regarding
> Eclipse PDE (http://felix.apache.org/site/maven-bundle-plugin-bnd.html).
> But now I have a couple of questions...
>
> 1. So Fabio attached his POM and upon Stuart's suggestion he included the
> RCP dependencies that he required.  However Fabio made all the Eclipse
> dependencies at the 'compile' scope.  I would have thought these
> dependencies would need to be at the 'provided' scope.  Otherwise the embed
> feature of the maven-bundle plugin would try to embed these jars.  If I am
> wrong and the dependencies could be 'compile' then does he need to specify
> them all or can he rely on the transitive dependencies?
>

yes, I prefer to use 'provided' scope for dependent bundles but this isn't a
hard rule.

the Embed-Dependency feature is not enabled by default, so compile and
runtime
dependencies won't be embedded unless you set this option, and even then you
can choose the match filter to select specific dependencies.

the one place you have to be careful of compile and runtime dependencies is
when
you set a 'wide' Export-Package or Private-Package because Bnd works on the
full
compilation classpath (excluding provided dependencies) and a wildcard like
* would
then pull-in all classes from the compile and runtime dependencies

I also tend to mark embedded dependencies as <optional>true</optional>
because
then Maven will only use them during compilation, and not for projects that
actually
depend on this bundle (which by definition has them embedded)

2. When you scrape Eclipse using the eclipe:maven-to goal the SWT jar that
> is created at org.eclipse.swt doesn't contain any code.  I imagine it is
> like this as swt is platform dependent?  Does this mean I have to use the
> 'system' scope and specify the jar?  Finally out of curiosity why doesn't
> the SWT jar have the interfaces included?
>

as you found out a lot of the SWT bundles are platform specific

3. I am new to RCP so this may be a stupid question.  When you generate an
> example RCP plugin with a view in the Manifest file they have the
> Require-Bundle tag where you specify the bundles that you depend on.  I
> don't see a way of populating that list with the maven-bundle plugin other
> than in the instruction section.  But this means that there will be 2
> places
> to specify plugins or bundles we depend on: in the dependencies and in the
> instructions.
>

yes, currently you have to set Require-Bundle manually, although I would
suggest
using it as sparingly as possible.  For most situations Import-Package is
enough,
and is also more flexible, as you don't mind who actually provides the
package.

I guess we could consider adding a "Require-Dependency" feature that works
like
Embed-Dependency, but instead adds the necessary Require-Bundle instructions
- but I'm not sure we should make Require-Bundle easy to use ;)

see:

   http://issues.apache.org/jira/browse/FELIX/component/12311143

for requesting features / raising bugs

HTH

Hopefully someone can help this newbie out!
> Thanks,
> Alex
>

-- 
Cheers, Stuart

Reply via email to