On 24/09/2007, [EMAIL PROTECTED] <[EMAIL PROTECTED]> 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
> [EMAIL PROTECTED]
> homepage: www.aldana-online.de
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Cheers, Stuart

Reply via email to