You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by "aldana@gmx.de" <al...@gmx.de> on 2007/09/20 18:50:49 UTC

connection of maven-bundle-plugin functionality to eclipse IDE OSGi startup?

hi,

i managed to generate a bundle which lets itself install and start on 
commandline osgi-container. for the developing phase of course i would 
like to use OSGi runtime inside eclipse IDE, so debugging is possible 
and implement/run cycle is short.

i am building my bundle with maven bundle-plugin and following settings:

<instructions>
 ...
  <Embed-Transitive>true</Embed-Transitive>
  
<Embed-Dependency>*;groupId=!org.eclipse.equinox;inline=false</Embed-Dependency>
 ...
</instructions>

basically running my osgi bundle inside eclipse works if i add generated 
manifest to <rootFolderOfProject>/META-INF and if i layout embedded 
dependencies (see settings above) in <rootFolderOfProject> too (as 
stated in generated MANIFEST.MF). of course this manual actions are too 
much and hence not doable when developing.

has anybody experience/suggestions in getting the bundle for release 
right and working inside eclipse IDE with same maven-bundle-plugin 
settings (dependencies are referenced correctly and correct path of 
MANIFEST.MF is set when doing RunAs...->OSGiStartup)?

thanks!


-- 
 manuel aldana
 aldana@gmx.de
 homepage: www.aldana-online.de


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


Re: AW: connection of maven-bundle-plugin functionality to eclipse IDE OSGi startup?

Posted by Stuart McCulloch <st...@jayway.net>.
On 24/09/2007, aldana@gmx.de <al...@gmx.de> wrote:
>
> Hampel, Michael schrieb:
> > Hello Stuart,
> >
> > I have tried it and it's working great - thank you a lot for the fast
> help,
> >
> i agree with that, thanks!
>
> but still there is a problem with dependency resolution.  i am using
> <Embed-Dependency> set to true, thus for release build Bundle-Classpath
> entries and respective jars are included inside bundle. this is working
> when using an 'outside' eclipse OSGi container, because i do provide a
> complete bundle.
> which does not working is starting OSGi bundle inside eclipse. following
> generated MANIFEST.MF gets included (only snippet provided):
> ...
> Include-Resource: log4j/log4j-1.2.12.jar=C:\Documents and
> Settings\manuel.aldana\.m2\repository\log4j\log4j\1.2.12\log4j-1.2.12.jar
> ...
>
> with this setting OSGi runtime gives me NoClassDefFoundError (log4j
> class), so it seems that Include-Resource statement gets ignored by
> eclipse PDE plugin


that's correct: Include-Resource is specific to BND and is not used by PDE

so, how can i tell eclipse PDE to include libraries
> as stated in Include-Resource from MANIFEST.MF? or is Include-Resource
> the wrong place look for? what other configuration can be used to
> connect to eclipse PDE to integrate maven's dependency resolution?


well, Eclipse PDE will use the bundle classpath to look for the embedded
jars
but unfortunately it will do this from the project root - so it's probably
looking
for <project>/log4j/log4j-1.2.12.jar

the (hopeful) solution of above problem should be the last bit to make
> the bridge between maven and eclipse PDE complete :)


there are 2 solutions, the first I mentioned earlier in this thread:

1)  put dependencies under a target/dependency folder (with no group
sub-folder):

        <Embed-Directory>target/dependency</Embed-Directory>
        <Embed-StripGroup>true</Embed-StripGroup>

      you can then use the dependency plugin "copy-dependencies" goal to
copy the
      dependencies locally - they should then match the bundle classpath
entries for
      Eclipse PDE

2)   the second option involves unpacking the bundle and munging the
manifest
      placed at the project root, so the bundle-classpath entries match the
actual
      locations of the unpacked bundle under 'target'

the second option is what's used in Pax-Construct's plugin - this means it
can also
support bundles that don't happen to use embedded entries starting with
'target'

if you want to try out the pax plugin on an existing bundle, add this to
your pom:

  <pluginRepositories>
    <pluginRepository>
      <id>ops4j-repository</id>
      <url>http://repository.ops4j.org/maven2</url>
    </pluginRepository>
  </pluginRepositories>

and then type the following to generate the project files and manifest:

  mvn clean install
org.ops4j.pax.construct.ng:maven-pax-plugin:0.2.0-beta1:eclipse

(the full plugin name is required to access this specific beta version)

--
> manuel aldana
> aldana@gmx.de
> homepage: www.aldana-online.de
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


-- 
Cheers, Stuart

Re: AW: connection of maven-bundle-plugin functionality to eclipse IDE OSGi startup?

Posted by "aldana@gmx.de" <al...@gmx.de>.
Hampel, Michael schrieb:
> Hello Stuart,
>
> I have tried it and it's working great - thank you a lot for the fast help,
>   
i agree with that, thanks!

but still there is a problem with dependency resolution.  i am using 
<Embed-Dependency> set to true, thus for release build Bundle-Classpath 
entries and respective jars are included inside bundle. this is working 
when using an 'outside' eclipse OSGi container, because i do provide a 
complete bundle.
which does not working is starting OSGi bundle inside eclipse. following 
generated MANIFEST.MF gets included (only snippet provided):
...
Include-Resource: log4j/log4j-1.2.12.jar=C:\Documents and 
Settings\manuel.aldana\.m2\repository\log4j\log4j\1.2.12\log4j-1.2.12.jar
...

with this setting OSGi runtime gives me NoClassDefFoundError (log4j 
class), so it seems that Include-Resource statement gets ignored by 
eclipse PDE plugin so, how can i tell eclipse PDE to include libraries 
as stated in Include-Resource from MANIFEST.MF? or is Include-Resource 
the wrong place look for? what other configuration can be used to 
connect to eclipse PDE to integrate maven's dependency resolution?

the (hopeful) solution of above problem should be the last bit to make 
the bridge between maven and eclipse PDE complete :)

-- 
 manuel aldana
 aldana@gmx.de
 homepage: www.aldana-online.de


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


AW: connection of maven-bundle-plugin functionality to eclipse IDE OSGi startup?

Posted by "Hampel, Michael" <mi...@siemens.com>.
Hello Stuart,

I have tried it and it's working great - thank you a lot for the fast help,

Michael  




-----Ursprüngliche Nachricht-----
Von: mcculls@gmail.com [mailto:mcculls@gmail.com] Im Auftrag von Stuart McCulloch
Gesendet: Freitag, 21. September 2007 13:31
An: users@felix.apache.org
Betreff: Re: connection of maven-bundle-plugin functionality to eclipse IDE OSGi startup?

On 21/09/2007, Stuart McCulloch <st...@jayway.net> wrote:
>
> On 21/09/2007, Stuart McCulloch <st...@jayway.net> wrote:
> >
> > perhaps we should update the bundle goal so it also writes the manifest
> > to the
> > file system, by default to target/classes/META-INF but allow custom
> > locations...
> > then you'd only need to use one goal to build the bundle and get the
> > manifest,
> > rather then computing it twice - I'll probably raise a JIRA issue to
> > support this
> >
>
> done... see https://issues.apache.org/jira/browse/FELIX-376
>

... and done!  if you compile the plugin from trunk you can now set the
manifest directory :)

-- 
Cheers, Stuart

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


Re: connection of maven-bundle-plugin functionality to eclipse IDE OSGi startup?

Posted by Stuart McCulloch <st...@jayway.net>.
On 21/09/2007, Stuart McCulloch <st...@jayway.net> wrote:
>
> On 21/09/2007, Stuart McCulloch <st...@jayway.net> wrote:
> >
> > perhaps we should update the bundle goal so it also writes the manifest
> > to the
> > file system, by default to target/classes/META-INF but allow custom
> > locations...
> > then you'd only need to use one goal to build the bundle and get the
> > manifest,
> > rather then computing it twice - I'll probably raise a JIRA issue to
> > support this
> >
>
> done... see https://issues.apache.org/jira/browse/FELIX-376
>

... and done!  if you compile the plugin from trunk you can now set the
manifest directory :)

-- 
Cheers, Stuart

Re: connection of maven-bundle-plugin functionality to eclipse IDE OSGi startup?

Posted by Stuart McCulloch <st...@jayway.net>.
Hi Michael,

On 21/09/2007, Hampel, Michael <mi...@siemens.com> wrote:
>
> Hello Stuart,
>
> thanx for the clarification and also for the proposed solution to add a
> configurable Manifest
> Output location to the bundle plugin. I think this is the best solution.
> I have another question about using the bnd -split-package directive with
> the bundle-plugin.
> I have used other directives like -exportcontents with the plugin which
> worked but not the
> -split-package directive when using it this way
>
> <_split-package>merge-last</_split-package>
>
> It is not a big problem - also without setting the directive BND merges
> the packages in the right
> way but outputs warnings that it misses the directive.


the -split-package directive is different in that it applies to individual
packages
so you need something like this example, which you can find on the BND page:

    Private-Package: test.pack;-split-package:=merge-first

it can be a bit of a pain to add this individually to packages, rather than
have
a global option - but it usually indicates a potential issue that needs
addressing

btw, could you post the BND instructions from the POM that causes this
warning?
it may be that there's a simpler way to avoid this split package message...

( Peter's site appears offline at the moment, but cached version is
available at
  http://72.14.235.104/search?q=cache:7_pSxRJxomMJ:www.aqute.biz/Code/Bnd )

Thank you again,
>
> Michael
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: mcculls@gmail.com [mailto:mcculls@gmail.com] Im Auftrag von Stuart
> McCulloch
> Gesendet: Freitag, 21. September 2007 10:00
> An: users@felix.apache.org
> Betreff: Re: connection of maven-bundle-plugin functionality to eclipse
> IDE OSGi startup?
>
> On 21/09/2007, Stuart McCulloch <st...@jayway.net> wrote:
> >
> > Hi Michael,
> >
> > On 21/09/2007, Hampel, Michael <mi...@siemens.com> wrote:
> > >
> > > Hello,
> > >
> > > Regarding the answer of Stuart I have a question about the intended
> use
> > > of the bundleplugin
> > > Manifest goal.
> > > In the moment we are using the goal to generate the Manifest file to
> run
> > > our bundles within
> > > Eclipse (put the generated Manifest file where Eclipse expects it).
> (the
> > > manifest goal runs additional
> > > To the bundle goal)
> > > This process works and is easy to install. I know that in certain
> > > circumstances you will get
> > > Differing manifest files from the manifest and bundle process - but
> > > in  most cases they are the same.
> > > Stuart could you please detail why I should not use the manifest goal
> in
> > > the described way?
> >
> >
> > it was really more of a warning to Manuel not to rely on it in this
> > scenario
> > as it wasn't originally designed for this use (it recomputes the
> manifest)
> >
> > differences usually occur when embedding dependencies or including
> > resources
> > - basically when the bundle contents aren't directly derived from the
> > classpath
> >
> > if you run the manifest goal _after_ the bundle goal then it usually
> does
> > match,
> > but in this particular scenario (where Manuel wants to embed
> dependencies)
> > it
> > is safer to extract the manifest rather than use the manifest goal.
> >
> > perhaps we should update the bundle goal so it also writes the manifest
> to
> > the
> > file system, by default to target/classes/META-INF but allow custom
> > locations...
> > then you'd only need to use one goal to build the bundle and get the
> > manifest,
> > rather then computing it twice - I'll probably raise a JIRA issue to
> > support this
> >
>
> done... see https://issues.apache.org/jira/browse/FELIX-376
>
> Thanx in advance for any help,
> > >
> > > Michael
> > >
> > >
> > >
> > >
> > > -----Ursprüngliche Nachricht-----
> > > Von: mcculls@gmail.com [mailto:mcculls@gmail.com ] Im Auftrag von
> Stuart
> > > McCulloch
> > > Gesendet: Freitag, 21. September 2007 05:00
> > > An: users@felix.apache.org
> > > Betreff: Re: connection of maven-bundle-plugin functionality to
> eclipse
> > > IDE OSGi startup?
> > >
> > > On 21/09/2007, aldana@gmx.de <al...@gmx.de> wrote:
> > > >
> > > > hi,
> > > >
> > > > i managed to generate a bundle which lets itself install and start
> on
> > > > commandline osgi-container. for the developing phase of course i
> would
> > > > like to use OSGi runtime inside eclipse IDE, so debugging is
> possible
> > > > and implement/run cycle is short.
> > > >
> > > > i am building my bundle with maven bundle-plugin and following
> > > settings:
> > > >
> > > > <instructions>
> > > > ...
> > > >   <Embed-Transitive>true</Embed-Transitive>
> > > >
> > > >
> > > >
> > >
> <Embed-Dependency>*;groupId=!org.eclipse.equinox;inline=false</Embed-Dependency>
> > >
> > > > ...
> > > > </instructions>
> > > >
> > > > basically running my osgi bundle inside eclipse works if i add
> > > generated
> > > > manifest to <rootFolderOfProject>/META-INF and if i layout embedded
> > > > dependencies (see settings above) in <rootFolderOfProject> too (as
> > > > stated in generated MANIFEST.MF). of course this manual actions are
> > > too
> > > > much and hence not doable when developing.
> > >
> > >
> > > yes - these are limitations of Eclipse PDE, which expects the manifest
> > > in a
> > > particular
> > > place (which doesn't match well with Maven, where generated files go
> > > inside
> > > target)
> > > and expects embedded jars to be exactly placed relative to the project
> > > root.
> > >
> > > has anybody experience/suggestions in getting the bundle for release
> > > > right and working inside eclipse IDE with same maven-bundle-plugin
> > > > settings (dependencies are referenced correctly and correct path of
> > > > MANIFEST.MF is set when doing RunAs...->OSGiStartup)?
> > >
> > >
> > > there are a couple of things that can help automate this:
> > >
> > > 1)  put dependencies under a target/dependency folder (with no group
> > > sub-folder):
> > >
> > >         <Embed-Directory>target/dependency</Embed-Directory>
> > >         <Embed-StripGroup>true</Embed-StripGroup>
> > >
> > >       you can then use the dependency plugin "copy-dependencies" goal
> to
> > > copy the
> > >       dependencies locally - they should then match the classpath
> > > entries
> > > for Eclipse
> > >
> > > 2)  unpack the generated manifest using another plugin (either antrun
> or
> > > exec plugin)
> > >      - you can't use the bundleplugin manifest goal, as that's
> designed
> > > to
> > > work against
> > >      existing non-OSGi artifacts that need wrapping
> > >
> > > FYI, the Pax-Construct plugin and archetypes do a lot of this for you
> > > behind
> > > the scenes:
> > >
> > >    http://wiki.ops4j.org/confluence/x/8Q
> > >
> > > however, I'd strongly suggest trying out the Pax-Construct v2 *beta*
> as
> > > it
> > > uses a much
> > > cleaner project layout and has a bit better Eclipse integration (it
> > > munges
> > > the manifest
> > > before copying it to the PDE location, so you can put embedded jars
> > > anywhere
> > > you like)
> > >
> > >
> > >
> > >
> http://mcculls.blogspot.com/2007/09/calling-all-testers-pax-construct-v2.html
> > >
> > > Unfortunately the documentation is lacking, but each script supports
> -h
> > > for
> > > help, and just
> > > running the script without any options will get it to prompt you, with
> > > example responses.
> > > Full documentation should be there next week :)
> > >
> > > There is one remaining niggle when developing OSGi with Eclipse and
> > > Maven -
> > > in Eclipse
> > > developers tend to edit the PDE manifest first to add required
> packages
> > > to
> > > the import list.
> > > Then they build using Maven and wonder why it's failing - this is
> > > because
> > > they haven't told
> > > Maven of the required dependency!
> > >
> > > Projects like q4e ( http://code.google.com/p/q4e) can help, as they
> make
> > > it
> > > easier to add
> > > dependencies direct from Eclipse, but they're in the early stages of
> > > integration. There are
> > > also ways to make your local Eclipse installation appear as a maven
> > > repository, so you can
> > > reference Eclipse jars from maven without having to locate a remote
> repo
> > > for
> > > them:
> > >
> > >    http://docs.codehaus.org/display/MAVENUSER/Eclipse+Plugin
> > >
> > > HTH
> > >
> > > thanks!
> > > >
> > > >
> > > > --
> > > > manuel aldana
> > > > aldana@gmx.de
> > > > homepage: www.aldana-online.de
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > > > For additional commands, e-mail: users-help@felix.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > Cheers, Stuart
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > > For additional commands, e-mail: users-help@felix.apache.org
> > >
> > >
> >
> >
> > --
> > Cheers, Stuart
>
>
>
>
> --
> Cheers, Stuart
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


-- 
Cheers, Stuart

Re: connection of maven-bundle-plugin functionality to eclipse IDE OSGi startup?

Posted by Karl Pauls <ka...@gmail.com>.
The directive need to be added to the packages like so:

<Export-Package>: foo.bar;-split-package=merge-last</Export-Package>

regards,

Karl

On 9/21/07, Hampel, Michael <mi...@siemens.com> wrote:
> Hello Stuart,
>
> thanx for the clarification and also for the proposed solution to add a configurable Manifest
> Output location to the bundle plugin. I think this is the best solution.
> I have another question about using the bnd -split-package directive with the bundle-plugin.
> I have used other directives like -exportcontents with the plugin which worked but not the
> -split-package directive when using it this way
>
> <_split-package>merge-last</_split-package>
>
> It is not a big problem - also without setting the directive BND merges the packages in the right
> way but outputs warnings that it misses the directive.
>
> Thank you again,
>
> Michael
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: mcculls@gmail.com [mailto:mcculls@gmail.com] Im Auftrag von Stuart McCulloch
> Gesendet: Freitag, 21. September 2007 10:00
> An: users@felix.apache.org
> Betreff: Re: connection of maven-bundle-plugin functionality to eclipse IDE OSGi startup?
>
> On 21/09/2007, Stuart McCulloch <st...@jayway.net> wrote:
> >
> > Hi Michael,
> >
> > On 21/09/2007, Hampel, Michael <mi...@siemens.com> wrote:
> > >
> > > Hello,
> > >
> > > Regarding the answer of Stuart I have a question about the intended use
> > > of the bundleplugin
> > > Manifest goal.
> > > In the moment we are using the goal to generate the Manifest file to run
> > > our bundles within
> > > Eclipse (put the generated Manifest file where Eclipse expects it). (the
> > > manifest goal runs additional
> > > To the bundle goal)
> > > This process works and is easy to install. I know that in certain
> > > circumstances you will get
> > > Differing manifest files from the manifest and bundle process - but
> > > in  most cases they are the same.
> > > Stuart could you please detail why I should not use the manifest goal in
> > > the described way?
> >
> >
> > it was really more of a warning to Manuel not to rely on it in this
> > scenario
> > as it wasn't originally designed for this use (it recomputes the manifest)
> >
> > differences usually occur when embedding dependencies or including
> > resources
> > - basically when the bundle contents aren't directly derived from the
> > classpath
> >
> > if you run the manifest goal _after_ the bundle goal then it usually does
> > match,
> > but in this particular scenario (where Manuel wants to embed dependencies)
> > it
> > is safer to extract the manifest rather than use the manifest goal.
> >
> > perhaps we should update the bundle goal so it also writes the manifest to
> > the
> > file system, by default to target/classes/META-INF but allow custom
> > locations...
> > then you'd only need to use one goal to build the bundle and get the
> > manifest,
> > rather then computing it twice - I'll probably raise a JIRA issue to
> > support this
> >
>
> done... see https://issues.apache.org/jira/browse/FELIX-376
>
> Thanx in advance for any help,
> > >
> > > Michael
> > >
> > >
> > >
> > >
> > > -----Ursprüngliche Nachricht-----
> > > Von: mcculls@gmail.com [mailto:mcculls@gmail.com ] Im Auftrag von Stuart
> > > McCulloch
> > > Gesendet: Freitag, 21. September 2007 05:00
> > > An: users@felix.apache.org
> > > Betreff: Re: connection of maven-bundle-plugin functionality to eclipse
> > > IDE OSGi startup?
> > >
> > > On 21/09/2007, aldana@gmx.de <al...@gmx.de> wrote:
> > > >
> > > > hi,
> > > >
> > > > i managed to generate a bundle which lets itself install and start on
> > > > commandline osgi-container. for the developing phase of course i would
> > > > like to use OSGi runtime inside eclipse IDE, so debugging is possible
> > > > and implement/run cycle is short.
> > > >
> > > > i am building my bundle with maven bundle-plugin and following
> > > settings:
> > > >
> > > > <instructions>
> > > > ...
> > > >   <Embed-Transitive>true</Embed-Transitive>
> > > >
> > > >
> > > >
> > > <Embed-Dependency>*;groupId=!org.eclipse.equinox;inline=false</Embed-Dependency>
> > >
> > > > ...
> > > > </instructions>
> > > >
> > > > basically running my osgi bundle inside eclipse works if i add
> > > generated
> > > > manifest to <rootFolderOfProject>/META-INF and if i layout embedded
> > > > dependencies (see settings above) in <rootFolderOfProject> too (as
> > > > stated in generated MANIFEST.MF). of course this manual actions are
> > > too
> > > > much and hence not doable when developing.
> > >
> > >
> > > yes - these are limitations of Eclipse PDE, which expects the manifest
> > > in a
> > > particular
> > > place (which doesn't match well with Maven, where generated files go
> > > inside
> > > target)
> > > and expects embedded jars to be exactly placed relative to the project
> > > root.
> > >
> > > has anybody experience/suggestions in getting the bundle for release
> > > > right and working inside eclipse IDE with same maven-bundle-plugin
> > > > settings (dependencies are referenced correctly and correct path of
> > > > MANIFEST.MF is set when doing RunAs...->OSGiStartup)?
> > >
> > >
> > > there are a couple of things that can help automate this:
> > >
> > > 1)  put dependencies under a target/dependency folder (with no group
> > > sub-folder):
> > >
> > >         <Embed-Directory>target/dependency</Embed-Directory>
> > >         <Embed-StripGroup>true</Embed-StripGroup>
> > >
> > >       you can then use the dependency plugin "copy-dependencies" goal to
> > > copy the
> > >       dependencies locally - they should then match the classpath
> > > entries
> > > for Eclipse
> > >
> > > 2)  unpack the generated manifest using another plugin (either antrun or
> > > exec plugin)
> > >      - you can't use the bundleplugin manifest goal, as that's designed
> > > to
> > > work against
> > >      existing non-OSGi artifacts that need wrapping
> > >
> > > FYI, the Pax-Construct plugin and archetypes do a lot of this for you
> > > behind
> > > the scenes:
> > >
> > >    http://wiki.ops4j.org/confluence/x/8Q
> > >
> > > however, I'd strongly suggest trying out the Pax-Construct v2 *beta* as
> > > it
> > > uses a much
> > > cleaner project layout and has a bit better Eclipse integration (it
> > > munges
> > > the manifest
> > > before copying it to the PDE location, so you can put embedded jars
> > > anywhere
> > > you like)
> > >
> > >
> > >
> > > http://mcculls.blogspot.com/2007/09/calling-all-testers-pax-construct-v2.html
> > >
> > > Unfortunately the documentation is lacking, but each script supports -h
> > > for
> > > help, and just
> > > running the script without any options will get it to prompt you, with
> > > example responses.
> > > Full documentation should be there next week :)
> > >
> > > There is one remaining niggle when developing OSGi with Eclipse and
> > > Maven -
> > > in Eclipse
> > > developers tend to edit the PDE manifest first to add required packages
> > > to
> > > the import list.
> > > Then they build using Maven and wonder why it's failing - this is
> > > because
> > > they haven't told
> > > Maven of the required dependency!
> > >
> > > Projects like q4e ( http://code.google.com/p/q4e) can help, as they make
> > > it
> > > easier to add
> > > dependencies direct from Eclipse, but they're in the early stages of
> > > integration. There are
> > > also ways to make your local Eclipse installation appear as a maven
> > > repository, so you can
> > > reference Eclipse jars from maven without having to locate a remote repo
> > > for
> > > them:
> > >
> > >    http://docs.codehaus.org/display/MAVENUSER/Eclipse+Plugin
> > >
> > > HTH
> > >
> > > thanks!
> > > >
> > > >
> > > > --
> > > > manuel aldana
> > > > aldana@gmx.de
> > > > homepage: www.aldana-online.de
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > > > For additional commands, e-mail: users-help@felix.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > Cheers, Stuart
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > > For additional commands, e-mail: users-help@felix.apache.org
> > >
> > >
> >
> >
> > --
> > Cheers, Stuart
>
>
>
>
> --
> Cheers, Stuart
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


-- 
Karl Pauls
karlpauls@gmail.com

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


AW: connection of maven-bundle-plugin functionality to eclipse IDE OSGi startup?

Posted by "Hampel, Michael" <mi...@siemens.com>.
Hello Stuart,

thanx for the clarification and also for the proposed solution to add a configurable Manifest
Output location to the bundle plugin. I think this is the best solution.
I have another question about using the bnd -split-package directive with the bundle-plugin.
I have used other directives like -exportcontents with the plugin which worked but not the 
-split-package directive when using it this way

<_split-package>merge-last</_split-package>

It is not a big problem - also without setting the directive BND merges the packages in the right
way but outputs warnings that it misses the directive. 

Thank you again,

Michael




-----Ursprüngliche Nachricht-----
Von: mcculls@gmail.com [mailto:mcculls@gmail.com] Im Auftrag von Stuart McCulloch
Gesendet: Freitag, 21. September 2007 10:00
An: users@felix.apache.org
Betreff: Re: connection of maven-bundle-plugin functionality to eclipse IDE OSGi startup?

On 21/09/2007, Stuart McCulloch <st...@jayway.net> wrote:
>
> Hi Michael,
>
> On 21/09/2007, Hampel, Michael <mi...@siemens.com> wrote:
> >
> > Hello,
> >
> > Regarding the answer of Stuart I have a question about the intended use
> > of the bundleplugin
> > Manifest goal.
> > In the moment we are using the goal to generate the Manifest file to run
> > our bundles within
> > Eclipse (put the generated Manifest file where Eclipse expects it). (the
> > manifest goal runs additional
> > To the bundle goal)
> > This process works and is easy to install. I know that in certain
> > circumstances you will get
> > Differing manifest files from the manifest and bundle process - but
> > in  most cases they are the same.
> > Stuart could you please detail why I should not use the manifest goal in
> > the described way?
>
>
> it was really more of a warning to Manuel not to rely on it in this
> scenario
> as it wasn't originally designed for this use (it recomputes the manifest)
>
> differences usually occur when embedding dependencies or including
> resources
> - basically when the bundle contents aren't directly derived from the
> classpath
>
> if you run the manifest goal _after_ the bundle goal then it usually does
> match,
> but in this particular scenario (where Manuel wants to embed dependencies)
> it
> is safer to extract the manifest rather than use the manifest goal.
>
> perhaps we should update the bundle goal so it also writes the manifest to
> the
> file system, by default to target/classes/META-INF but allow custom
> locations...
> then you'd only need to use one goal to build the bundle and get the
> manifest,
> rather then computing it twice - I'll probably raise a JIRA issue to
> support this
>

done... see https://issues.apache.org/jira/browse/FELIX-376

Thanx in advance for any help,
> >
> > Michael
> >
> >
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: mcculls@gmail.com [mailto:mcculls@gmail.com ] Im Auftrag von Stuart
> > McCulloch
> > Gesendet: Freitag, 21. September 2007 05:00
> > An: users@felix.apache.org
> > Betreff: Re: connection of maven-bundle-plugin functionality to eclipse
> > IDE OSGi startup?
> >
> > On 21/09/2007, aldana@gmx.de <al...@gmx.de> wrote:
> > >
> > > hi,
> > >
> > > i managed to generate a bundle which lets itself install and start on
> > > commandline osgi-container. for the developing phase of course i would
> > > like to use OSGi runtime inside eclipse IDE, so debugging is possible
> > > and implement/run cycle is short.
> > >
> > > i am building my bundle with maven bundle-plugin and following
> > settings:
> > >
> > > <instructions>
> > > ...
> > >   <Embed-Transitive>true</Embed-Transitive>
> > >
> > >
> > >
> > <Embed-Dependency>*;groupId=!org.eclipse.equinox;inline=false</Embed-Dependency>
> >
> > > ...
> > > </instructions>
> > >
> > > basically running my osgi bundle inside eclipse works if i add
> > generated
> > > manifest to <rootFolderOfProject>/META-INF and if i layout embedded
> > > dependencies (see settings above) in <rootFolderOfProject> too (as
> > > stated in generated MANIFEST.MF). of course this manual actions are
> > too
> > > much and hence not doable when developing.
> >
> >
> > yes - these are limitations of Eclipse PDE, which expects the manifest
> > in a
> > particular
> > place (which doesn't match well with Maven, where generated files go
> > inside
> > target)
> > and expects embedded jars to be exactly placed relative to the project
> > root.
> >
> > has anybody experience/suggestions in getting the bundle for release
> > > right and working inside eclipse IDE with same maven-bundle-plugin
> > > settings (dependencies are referenced correctly and correct path of
> > > MANIFEST.MF is set when doing RunAs...->OSGiStartup)?
> >
> >
> > there are a couple of things that can help automate this:
> >
> > 1)  put dependencies under a target/dependency folder (with no group
> > sub-folder):
> >
> >         <Embed-Directory>target/dependency</Embed-Directory>
> >         <Embed-StripGroup>true</Embed-StripGroup>
> >
> >       you can then use the dependency plugin "copy-dependencies" goal to
> > copy the
> >       dependencies locally - they should then match the classpath
> > entries
> > for Eclipse
> >
> > 2)  unpack the generated manifest using another plugin (either antrun or
> > exec plugin)
> >      - you can't use the bundleplugin manifest goal, as that's designed
> > to
> > work against
> >      existing non-OSGi artifacts that need wrapping
> >
> > FYI, the Pax-Construct plugin and archetypes do a lot of this for you
> > behind
> > the scenes:
> >
> >    http://wiki.ops4j.org/confluence/x/8Q
> >
> > however, I'd strongly suggest trying out the Pax-Construct v2 *beta* as
> > it
> > uses a much
> > cleaner project layout and has a bit better Eclipse integration (it
> > munges
> > the manifest
> > before copying it to the PDE location, so you can put embedded jars
> > anywhere
> > you like)
> >
> >
> >
> > http://mcculls.blogspot.com/2007/09/calling-all-testers-pax-construct-v2.html
> >
> > Unfortunately the documentation is lacking, but each script supports -h
> > for
> > help, and just
> > running the script without any options will get it to prompt you, with
> > example responses.
> > Full documentation should be there next week :)
> >
> > There is one remaining niggle when developing OSGi with Eclipse and
> > Maven -
> > in Eclipse
> > developers tend to edit the PDE manifest first to add required packages
> > to
> > the import list.
> > Then they build using Maven and wonder why it's failing - this is
> > because
> > they haven't told
> > Maven of the required dependency!
> >
> > Projects like q4e ( http://code.google.com/p/q4e) can help, as they make
> > it
> > easier to add
> > dependencies direct from Eclipse, but they're in the early stages of
> > integration. There are
> > also ways to make your local Eclipse installation appear as a maven
> > repository, so you can
> > reference Eclipse jars from maven without having to locate a remote repo
> > for
> > them:
> >
> >    http://docs.codehaus.org/display/MAVENUSER/Eclipse+Plugin
> >
> > HTH
> >
> > thanks!
> > >
> > >
> > > --
> > > manuel aldana
> > > aldana@gmx.de
> > > homepage: www.aldana-online.de
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > > For additional commands, e-mail: users-help@felix.apache.org
> > >
> > >
> >
> >
> > --
> > Cheers, Stuart
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > For additional commands, e-mail: users-help@felix.apache.org
> >
> >
>
>
> --
> Cheers, Stuart




-- 
Cheers, Stuart

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


Re: connection of maven-bundle-plugin functionality to eclipse IDE OSGi startup?

Posted by Stuart McCulloch <st...@jayway.net>.
On 21/09/2007, Stuart McCulloch <st...@jayway.net> wrote:
>
> Hi Michael,
>
> On 21/09/2007, Hampel, Michael <mi...@siemens.com> wrote:
> >
> > Hello,
> >
> > Regarding the answer of Stuart I have a question about the intended use
> > of the bundleplugin
> > Manifest goal.
> > In the moment we are using the goal to generate the Manifest file to run
> > our bundles within
> > Eclipse (put the generated Manifest file where Eclipse expects it). (the
> > manifest goal runs additional
> > To the bundle goal)
> > This process works and is easy to install. I know that in certain
> > circumstances you will get
> > Differing manifest files from the manifest and bundle process - but
> > in  most cases they are the same.
> > Stuart could you please detail why I should not use the manifest goal in
> > the described way?
>
>
> it was really more of a warning to Manuel not to rely on it in this
> scenario
> as it wasn't originally designed for this use (it recomputes the manifest)
>
> differences usually occur when embedding dependencies or including
> resources
> - basically when the bundle contents aren't directly derived from the
> classpath
>
> if you run the manifest goal _after_ the bundle goal then it usually does
> match,
> but in this particular scenario (where Manuel wants to embed dependencies)
> it
> is safer to extract the manifest rather than use the manifest goal.
>
> perhaps we should update the bundle goal so it also writes the manifest to
> the
> file system, by default to target/classes/META-INF but allow custom
> locations...
> then you'd only need to use one goal to build the bundle and get the
> manifest,
> rather then computing it twice - I'll probably raise a JIRA issue to
> support this
>

done... see https://issues.apache.org/jira/browse/FELIX-376

Thanx in advance for any help,
> >
> > Michael
> >
> >
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: mcculls@gmail.com [mailto:mcculls@gmail.com ] Im Auftrag von Stuart
> > McCulloch
> > Gesendet: Freitag, 21. September 2007 05:00
> > An: users@felix.apache.org
> > Betreff: Re: connection of maven-bundle-plugin functionality to eclipse
> > IDE OSGi startup?
> >
> > On 21/09/2007, aldana@gmx.de <al...@gmx.de> wrote:
> > >
> > > hi,
> > >
> > > i managed to generate a bundle which lets itself install and start on
> > > commandline osgi-container. for the developing phase of course i would
> > > like to use OSGi runtime inside eclipse IDE, so debugging is possible
> > > and implement/run cycle is short.
> > >
> > > i am building my bundle with maven bundle-plugin and following
> > settings:
> > >
> > > <instructions>
> > > ...
> > >   <Embed-Transitive>true</Embed-Transitive>
> > >
> > >
> > >
> > <Embed-Dependency>*;groupId=!org.eclipse.equinox;inline=false</Embed-Dependency>
> >
> > > ...
> > > </instructions>
> > >
> > > basically running my osgi bundle inside eclipse works if i add
> > generated
> > > manifest to <rootFolderOfProject>/META-INF and if i layout embedded
> > > dependencies (see settings above) in <rootFolderOfProject> too (as
> > > stated in generated MANIFEST.MF). of course this manual actions are
> > too
> > > much and hence not doable when developing.
> >
> >
> > yes - these are limitations of Eclipse PDE, which expects the manifest
> > in a
> > particular
> > place (which doesn't match well with Maven, where generated files go
> > inside
> > target)
> > and expects embedded jars to be exactly placed relative to the project
> > root.
> >
> > has anybody experience/suggestions in getting the bundle for release
> > > right and working inside eclipse IDE with same maven-bundle-plugin
> > > settings (dependencies are referenced correctly and correct path of
> > > MANIFEST.MF is set when doing RunAs...->OSGiStartup)?
> >
> >
> > there are a couple of things that can help automate this:
> >
> > 1)  put dependencies under a target/dependency folder (with no group
> > sub-folder):
> >
> >         <Embed-Directory>target/dependency</Embed-Directory>
> >         <Embed-StripGroup>true</Embed-StripGroup>
> >
> >       you can then use the dependency plugin "copy-dependencies" goal to
> > copy the
> >       dependencies locally - they should then match the classpath
> > entries
> > for Eclipse
> >
> > 2)  unpack the generated manifest using another plugin (either antrun or
> > exec plugin)
> >      - you can't use the bundleplugin manifest goal, as that's designed
> > to
> > work against
> >      existing non-OSGi artifacts that need wrapping
> >
> > FYI, the Pax-Construct plugin and archetypes do a lot of this for you
> > behind
> > the scenes:
> >
> >    http://wiki.ops4j.org/confluence/x/8Q
> >
> > however, I'd strongly suggest trying out the Pax-Construct v2 *beta* as
> > it
> > uses a much
> > cleaner project layout and has a bit better Eclipse integration (it
> > munges
> > the manifest
> > before copying it to the PDE location, so you can put embedded jars
> > anywhere
> > you like)
> >
> >
> >
> > http://mcculls.blogspot.com/2007/09/calling-all-testers-pax-construct-v2.html
> >
> > Unfortunately the documentation is lacking, but each script supports -h
> > for
> > help, and just
> > running the script without any options will get it to prompt you, with
> > example responses.
> > Full documentation should be there next week :)
> >
> > There is one remaining niggle when developing OSGi with Eclipse and
> > Maven -
> > in Eclipse
> > developers tend to edit the PDE manifest first to add required packages
> > to
> > the import list.
> > Then they build using Maven and wonder why it's failing - this is
> > because
> > they haven't told
> > Maven of the required dependency!
> >
> > Projects like q4e ( http://code.google.com/p/q4e) can help, as they make
> > it
> > easier to add
> > dependencies direct from Eclipse, but they're in the early stages of
> > integration. There are
> > also ways to make your local Eclipse installation appear as a maven
> > repository, so you can
> > reference Eclipse jars from maven without having to locate a remote repo
> > for
> > them:
> >
> >    http://docs.codehaus.org/display/MAVENUSER/Eclipse+Plugin
> >
> > HTH
> >
> > thanks!
> > >
> > >
> > > --
> > > manuel aldana
> > > aldana@gmx.de
> > > homepage: www.aldana-online.de
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > > For additional commands, e-mail: users-help@felix.apache.org
> > >
> > >
> >
> >
> > --
> > Cheers, Stuart
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > For additional commands, e-mail: users-help@felix.apache.org
> >
> >
>
>
> --
> Cheers, Stuart




-- 
Cheers, Stuart

Re: connection of maven-bundle-plugin functionality to eclipse IDE OSGi startup?

Posted by Stuart McCulloch <st...@jayway.net>.
Hi Michael,

On 21/09/2007, Hampel, Michael <mi...@siemens.com> wrote:
>
> Hello,
>
> Regarding the answer of Stuart I have a question about the intended use of
> the bundleplugin
> Manifest goal.
> In the moment we are using the goal to generate the Manifest file to run
> our bundles within
> Eclipse (put the generated Manifest file where Eclipse expects it). (the
> manifest goal runs additional
> To the bundle goal)
> This process works and is easy to install. I know that in certain
> circumstances you will get
> Differing manifest files from the manifest and bundle process - but
> in  most cases they are the same.
> Stuart could you please detail why I should not use the manifest goal in
> the described way?


it was really more of a warning to Manuel not to rely on it in this scenario
as it wasn't originally designed for this use (it recomputes the manifest)

differences usually occur when embedding dependencies or including resources
- basically when the bundle contents aren't directly derived from the
classpath

if you run the manifest goal _after_ the bundle goal then it usually does
match,
but in this particular scenario (where Manuel wants to embed dependencies)
it
is safer to extract the manifest rather than use the manifest goal.

perhaps we should update the bundle goal so it also writes the manifest to
the
file system, by default to target/classes/META-INF but allow custom
locations...
then you'd only need to use one goal to build the bundle and get the
manifest,
rather then computing it twice - I'll probably raise a JIRA issue to support
this

Thanx in advance for any help,
>
> Michael
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: mcculls@gmail.com [mailto:mcculls@gmail.com] Im Auftrag von Stuart
> McCulloch
> Gesendet: Freitag, 21. September 2007 05:00
> An: users@felix.apache.org
> Betreff: Re: connection of maven-bundle-plugin functionality to eclipse
> IDE OSGi startup?
>
> On 21/09/2007, aldana@gmx.de <al...@gmx.de> wrote:
> >
> > hi,
> >
> > i managed to generate a bundle which lets itself install and start on
> > commandline osgi-container. for the developing phase of course i would
> > like to use OSGi runtime inside eclipse IDE, so debugging is possible
> > and implement/run cycle is short.
> >
> > i am building my bundle with maven bundle-plugin and following settings:
> >
> > <instructions>
> > ...
> >   <Embed-Transitive>true</Embed-Transitive>
> >
> >
> >
> <Embed-Dependency>*;groupId=!org.eclipse.equinox;inline=false</Embed-Dependency>
> > ...
> > </instructions>
> >
> > basically running my osgi bundle inside eclipse works if i add generated
> > manifest to <rootFolderOfProject>/META-INF and if i layout embedded
> > dependencies (see settings above) in <rootFolderOfProject> too (as
> > stated in generated MANIFEST.MF). of course this manual actions are too
> > much and hence not doable when developing.
>
>
> yes - these are limitations of Eclipse PDE, which expects the manifest in
> a
> particular
> place (which doesn't match well with Maven, where generated files go
> inside
> target)
> and expects embedded jars to be exactly placed relative to the project
> root.
>
> has anybody experience/suggestions in getting the bundle for release
> > right and working inside eclipse IDE with same maven-bundle-plugin
> > settings (dependencies are referenced correctly and correct path of
> > MANIFEST.MF is set when doing RunAs...->OSGiStartup)?
>
>
> there are a couple of things that can help automate this:
>
> 1)  put dependencies under a target/dependency folder (with no group
> sub-folder):
>
>         <Embed-Directory>target/dependency</Embed-Directory>
>         <Embed-StripGroup>true</Embed-StripGroup>
>
>       you can then use the dependency plugin "copy-dependencies" goal to
> copy the
>       dependencies locally - they should then match the classpath entries
> for Eclipse
>
> 2)  unpack the generated manifest using another plugin (either antrun or
> exec plugin)
>      - you can't use the bundleplugin manifest goal, as that's designed to
> work against
>      existing non-OSGi artifacts that need wrapping
>
> FYI, the Pax-Construct plugin and archetypes do a lot of this for you
> behind
> the scenes:
>
>    http://wiki.ops4j.org/confluence/x/8Q
>
> however, I'd strongly suggest trying out the Pax-Construct v2 *beta* as it
> uses a much
> cleaner project layout and has a bit better Eclipse integration (it munges
> the manifest
> before copying it to the PDE location, so you can put embedded jars
> anywhere
> you like)
>
>
>
> http://mcculls.blogspot.com/2007/09/calling-all-testers-pax-construct-v2.html
>
> Unfortunately the documentation is lacking, but each script supports -h
> for
> help, and just
> running the script without any options will get it to prompt you, with
> example responses.
> Full documentation should be there next week :)
>
> There is one remaining niggle when developing OSGi with Eclipse and Maven
> -
> in Eclipse
> developers tend to edit the PDE manifest first to add required packages to
> the import list.
> Then they build using Maven and wonder why it's failing - this is because
> they haven't told
> Maven of the required dependency!
>
> Projects like q4e (http://code.google.com/p/q4e) can help, as they make it
> easier to add
> dependencies direct from Eclipse, but they're in the early stages of
> integration. There are
> also ways to make your local Eclipse installation appear as a maven
> repository, so you can
> reference Eclipse jars from maven without having to locate a remote repo
> for
> them:
>
>    http://docs.codehaus.org/display/MAVENUSER/Eclipse+Plugin
>
> HTH
>
> thanks!
> >
> >
> > --
> > manuel aldana
> > aldana@gmx.de
> > homepage: www.aldana-online.de
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > For additional commands, e-mail: users-help@felix.apache.org
> >
> >
>
>
> --
> Cheers, Stuart
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


-- 
Cheers, Stuart

AW: connection of maven-bundle-plugin functionality to eclipse IDE OSGi startup?

Posted by "Hampel, Michael" <mi...@siemens.com>.
Hello,

Regarding the answer of Stuart I have a question about the intended use of the bundleplugin
Manifest goal.
In the moment we are using the goal to generate the Manifest file to run our bundles within
Eclipse (put the generated Manifest file where Eclipse expects it). (the manifest goal runs additional
To the bundle goal)
This process works and is easy to install. I know that in certain circumstances you will get
Differing manifest files from the manifest and bundle process - but in  most cases they are the same.
Stuart could you please detail why I should not use the manifest goal in the described way?

Thanx in advance for any help,

Michael




-----Ursprüngliche Nachricht-----
Von: mcculls@gmail.com [mailto:mcculls@gmail.com] Im Auftrag von Stuart McCulloch
Gesendet: Freitag, 21. September 2007 05:00
An: users@felix.apache.org
Betreff: Re: connection of maven-bundle-plugin functionality to eclipse IDE OSGi startup?

On 21/09/2007, aldana@gmx.de <al...@gmx.de> wrote:
>
> hi,
>
> i managed to generate a bundle which lets itself install and start on
> commandline osgi-container. for the developing phase of course i would
> like to use OSGi runtime inside eclipse IDE, so debugging is possible
> and implement/run cycle is short.
>
> i am building my bundle with maven bundle-plugin and following settings:
>
> <instructions>
> ...
>   <Embed-Transitive>true</Embed-Transitive>
>
>
> <Embed-Dependency>*;groupId=!org.eclipse.equinox;inline=false</Embed-Dependency>
> ...
> </instructions>
>
> basically running my osgi bundle inside eclipse works if i add generated
> manifest to <rootFolderOfProject>/META-INF and if i layout embedded
> dependencies (see settings above) in <rootFolderOfProject> too (as
> stated in generated MANIFEST.MF). of course this manual actions are too
> much and hence not doable when developing.


yes - these are limitations of Eclipse PDE, which expects the manifest in a
particular
place (which doesn't match well with Maven, where generated files go inside
target)
and expects embedded jars to be exactly placed relative to the project root.

has anybody experience/suggestions in getting the bundle for release
> right and working inside eclipse IDE with same maven-bundle-plugin
> settings (dependencies are referenced correctly and correct path of
> MANIFEST.MF is set when doing RunAs...->OSGiStartup)?


there are a couple of things that can help automate this:

1)  put dependencies under a target/dependency folder (with no group
sub-folder):

        <Embed-Directory>target/dependency</Embed-Directory>
        <Embed-StripGroup>true</Embed-StripGroup>

      you can then use the dependency plugin "copy-dependencies" goal to
copy the
      dependencies locally - they should then match the classpath entries
for Eclipse

2)  unpack the generated manifest using another plugin (either antrun or
exec plugin)
     - you can't use the bundleplugin manifest goal, as that's designed to
work against
     existing non-OSGi artifacts that need wrapping

FYI, the Pax-Construct plugin and archetypes do a lot of this for you behind
the scenes:

   http://wiki.ops4j.org/confluence/x/8Q

however, I'd strongly suggest trying out the Pax-Construct v2 *beta* as it
uses a much
cleaner project layout and has a bit better Eclipse integration (it munges
the manifest
before copying it to the PDE location, so you can put embedded jars anywhere
you like)


http://mcculls.blogspot.com/2007/09/calling-all-testers-pax-construct-v2.html

Unfortunately the documentation is lacking, but each script supports -h for
help, and just
running the script without any options will get it to prompt you, with
example responses.
Full documentation should be there next week :)

There is one remaining niggle when developing OSGi with Eclipse and Maven -
in Eclipse
developers tend to edit the PDE manifest first to add required packages to
the import list.
Then they build using Maven and wonder why it's failing - this is because
they haven't told
Maven of the required dependency!

Projects like q4e (http://code.google.com/p/q4e) can help, as they make it
easier to add
dependencies direct from Eclipse, but they're in the early stages of
integration. There are
also ways to make your local Eclipse installation appear as a maven
repository, so you can
reference Eclipse jars from maven without having to locate a remote repo for
them:

   http://docs.codehaus.org/display/MAVENUSER/Eclipse+Plugin

HTH

thanks!
>
>
> --
> manuel aldana
> aldana@gmx.de
> homepage: www.aldana-online.de
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


-- 
Cheers, Stuart

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


Re: connection of maven-bundle-plugin functionality to eclipse IDE OSGi startup?

Posted by Stuart McCulloch <st...@jayway.net>.
On 21/09/2007, aldana@gmx.de <al...@gmx.de> wrote:
>
> hi,
>
> i managed to generate a bundle which lets itself install and start on
> commandline osgi-container. for the developing phase of course i would
> like to use OSGi runtime inside eclipse IDE, so debugging is possible
> and implement/run cycle is short.
>
> i am building my bundle with maven bundle-plugin and following settings:
>
> <instructions>
> ...
>   <Embed-Transitive>true</Embed-Transitive>
>
>
> <Embed-Dependency>*;groupId=!org.eclipse.equinox;inline=false</Embed-Dependency>
> ...
> </instructions>
>
> basically running my osgi bundle inside eclipse works if i add generated
> manifest to <rootFolderOfProject>/META-INF and if i layout embedded
> dependencies (see settings above) in <rootFolderOfProject> too (as
> stated in generated MANIFEST.MF). of course this manual actions are too
> much and hence not doable when developing.


yes - these are limitations of Eclipse PDE, which expects the manifest in a
particular
place (which doesn't match well with Maven, where generated files go inside
target)
and expects embedded jars to be exactly placed relative to the project root.

has anybody experience/suggestions in getting the bundle for release
> right and working inside eclipse IDE with same maven-bundle-plugin
> settings (dependencies are referenced correctly and correct path of
> MANIFEST.MF is set when doing RunAs...->OSGiStartup)?


there are a couple of things that can help automate this:

1)  put dependencies under a target/dependency folder (with no group
sub-folder):

        <Embed-Directory>target/dependency</Embed-Directory>
        <Embed-StripGroup>true</Embed-StripGroup>

      you can then use the dependency plugin "copy-dependencies" goal to
copy the
      dependencies locally - they should then match the classpath entries
for Eclipse

2)  unpack the generated manifest using another plugin (either antrun or
exec plugin)
     - you can't use the bundleplugin manifest goal, as that's designed to
work against
     existing non-OSGi artifacts that need wrapping

FYI, the Pax-Construct plugin and archetypes do a lot of this for you behind
the scenes:

   http://wiki.ops4j.org/confluence/x/8Q

however, I'd strongly suggest trying out the Pax-Construct v2 *beta* as it
uses a much
cleaner project layout and has a bit better Eclipse integration (it munges
the manifest
before copying it to the PDE location, so you can put embedded jars anywhere
you like)


http://mcculls.blogspot.com/2007/09/calling-all-testers-pax-construct-v2.html

Unfortunately the documentation is lacking, but each script supports -h for
help, and just
running the script without any options will get it to prompt you, with
example responses.
Full documentation should be there next week :)

There is one remaining niggle when developing OSGi with Eclipse and Maven -
in Eclipse
developers tend to edit the PDE manifest first to add required packages to
the import list.
Then they build using Maven and wonder why it's failing - this is because
they haven't told
Maven of the required dependency!

Projects like q4e (http://code.google.com/p/q4e) can help, as they make it
easier to add
dependencies direct from Eclipse, but they're in the early stages of
integration. There are
also ways to make your local Eclipse installation appear as a maven
repository, so you can
reference Eclipse jars from maven without having to locate a remote repo for
them:

   http://docs.codehaus.org/display/MAVENUSER/Eclipse+Plugin

HTH

thanks!
>
>
> --
> manuel aldana
> aldana@gmx.de
> homepage: www.aldana-online.de
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


-- 
Cheers, Stuart