2009/7/14 Lewis, Eric <[email protected]>

> >
> > well it asks the Maven runtime for the list of resolved project
> > dependencies,
> > which could trigger download of missing/updated dependencies
> > to your local
> > Maven repo, but it doesn't copy these dependencies to your
> > project directory
> >
> > if you use Embed-Dependency the plugin will look for matching
> > dependencies
> > and add the appropriate "Include-Resource" instructions to
> > add the jars to
> > the
> > bundle (the Bnd Tool http://aqute.biz/Code/Bnd does the adding)
> >
> > but note that the Bnd Tool won't copy them to the build
> > directory - instead
> > they
> > are added to the jar in memory, and the jar is written out at
> > the end of the
> > build
>
> Ok, everything is totally clear now, thanks!
>
> >
> > also remember that the Bnd Tool only adds whatever
> > packages/resources you
> > instruct it to add (ie. it doesn't simply zip up
> > "target/classes" like the
> > jar plugin)
>
> Actually, I don't have any classes in that project, it's just a bundle
> containing all the dependencies from the app server.
>
> >
> > alternatively you could unpack the bundle after it has been
> > packaged by
> > using
> > the <unpackBundle> setting - however, the problem with this
> > is that you'll
> > want
> > to unpack under "target" (ie. a temporary directory) but PDE
> > expects paths
> > to
> > be relative to the project directory - so the
> > Bundle-ClassPath won't match
> >
> > this is where the "pax:eclipse" goal helps, because it munges
> > the entries in
> > the
> > Bundle-ClassPath in the Eclipse/PDE manifest so dependencies
> > and classes
> > appear to be in the right place for PDE (eg. "." becomes
> > "target/classes",
> > etc.)
>
> Thanks, but I'll definitely stick to the JAR files.
>
> >
> > I'm asking because at the moment, I have 40 JAR files downloaded as
> > > dependencies (by the dependencies plugin), but even though I specify
> > > <Bundle-ClassPath>.,{maven-dependencies}</Bundle-ClassPath>
> > > I only have 37 JARs in there.
> > >
> >
> > hard to say without seeing the dependency graph and your
> > embed instruction,
> > do you happen to notice anything in common wrt. the missing
> > dependencies?
>
>
> Ok, after adding dependency:tree and configuring things a bit better,
> they're now in sync.
>
> I'll add the relevant parts of my POM, just to be sure:
>
>      <plugin>
>        <groupId>org.apache.maven.plugins</groupId>
>        <artifactId>maven-dependency-plugin</artifactId>
>        <executions>
>          <execution>
>            <id>copy-dependencies</id>
>            <phase>validate</phase>
>            <goals>
>              <goal>copy-dependencies</goal>
>            </goals>
>            <configuration>
>              <includeScope>runtime</includeScope>
>              <excludeTypes>pom</excludeTypes>
>              <outputDirectory>${basedir}</outputDirectory>
>              <overWriteReleases>true</overWriteReleases>
>              <overWriteSnapshots>true</overWriteSnapshots>
>              <overWriteIfNewer>true</overWriteIfNewer>
>            </configuration>
>          </execution>
>        </executions>
>      </plugin>
>
>      <plugin>
>        <groupId>org.apache.felix</groupId>
>        <artifactId>maven-bundle-plugin</artifactId>
>        <extensions>true</extensions>
>        <configuration>
>          <manifestLocation>META-INF</manifestLocation>
>          <instructions>
>
>  <Bundle-SymbolicName>ch.ipi.esv.client.serverlib</Bundle-SymbolicName>
>            <Export-Package>*</Export-Package>


FYI, when embedding dependencies use <_exportcontents> not <Export-Package>
as explained here:


http://felix.apache.org/site/apache-felix-bundle-plugin-faq.html#ApacheFelixBundlePluginFAQ-WhenIembedadependencywhydoIseeduplicatedcontent%3F


> <Embed-Dependency>*;scope=compile|runtime;type=!pom</Embed-Dependency>
>            <Embed-Transitive>true</Embed-Transitive>
>            <Import-Package>org.slf4j,*</Import-Package>
>          </instructions>
>        </configuration>
>      </plugin>
>
> >
> > btw, you don't need to set Bundle-ClassPath when embedding
> > dependencies,
> > unless you want to re-order the entries - the plugin
> > automatically updates
> > the
> > Bundle-ClassPath to include any embedded dependencies
>
> Thanks, deleted.
>
> >
> > if you're using the dependency plugin to put dependent jars
> > at the project
> > root
> > then you don't need to use <Embed-Directory> - you'd only
> > need to use that
> > if you wanted to put the dependent jars in a sub-directory
> > (people sometimes
> > put them under target, so they don't litter the main directory)
>
>
> Since (as you said) I have to have them in the root directory, this part
> deleted as well.
>
>
> Now the Eclipse RCP developer is telling me that Eclipse doesn't like the
> MANIFEST format that Felix generates... weird!
> Have you ever heard of such problems? (He previously created the MANIFEST
> by hand, putting every JAR and every package in its own line)
>

sometimes a refresh (F5) is needed to get Eclipse in sync with the
file-system, if you run the build on the command line
otherwise double-click on the manifest then click on the MANIFEST.MF tab and
it should show which lines it doesn't like
- then post the errors here (or perhaps capture a screenshot?)

( PS. don't use PDE Tools -> Organize Manifests... as that will definitely
mess things up! )

Best regards,
> Eric
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

-- 
Cheers, Stuart

Reply via email to