On 19/04/2008, Niall Pemberton <[EMAIL PROTECTED]> wrote:
>
> On Fri, Apr 18, 2008 at 4:07 PM, mraible <[EMAIL PROTECTED]> wrote:
> >
> >  I have a Maven 2 project with <packaging>war</packaging>. I've
> hand-written a
> >  MANIFEST.MF to make my WAR OSGi-aware and have proven it works with
> Spring
> >  DM.
> >
> >  Now I want to get away from maintaining my MANIFEST and use the
> >  maven-bundle-plugin to generate it. Is it possible to use this plugin
> in a
> >  "war" project or does it only work with <packaging>bundle</packaging>?
>
> You can use the bundle plugin to just generate the MANIFEST (using the
> "manifest" goal) - this is what we've done in Apache Commons (thru's
> the parent pom) -
>
>
> http://svn.apache.org/repos/asf/commons/proper/commons-parent/tags/commons-parent-9/pom.xml
>
> The generated OSGi manifest is then merged in by the maven-jar-plugin.
> This is an alternative to using packaging "bundle".


btw, if you want to avoid manually setting the Bundle-ClassPath then you
could
use something like the following to match the bnd generated classpath
against
the actual WAR content:

  <configuration>
    <instructions>

<Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency>
      <Embed-Directory>WEB-INF/lib</Embed-Directory>
      <Embed-Transitive>true</Embed-Transitive>
    </instructions>
  </configuration>

which will mimic the maven WAR layout of
"WEB-INF/lib/artifactId-version.jar"

HTH

-- 
Cheers, Stuart

Reply via email to