2008/11/2 Hendy Irawan <[EMAIL PROTECTED]>

> On Sat, Nov 1, 2008 at 4:44 AM, Chris Custine <[EMAIL PROTECTED]> wrote:
>
>> If you are already using Maven I would look at the Felix maven bundle
>> plugin and the <Embed-Dependency> tag here:* http://tinyurl.com/5w6297 .*
>> This will generate your <Bundle-ClassPath> based on your maven dependencies.
>>
>> The Felix maven plugin normally generates an entire bundle for your
>> project, but since you are building a .war file you can just generate the
>> manifest using the technique here: *http://tinyurl.com/6q2gbw* and
>> include it in your war.
>
>
> Exactly, these two ideas are conflicting....!
>
> If I am using Embed-Dependency, project type has to be bundle and not
> war... this has some implications.
>

this is not true, if you use the 1.4.3 version of the plugin it should apply
the Embed-Dependency
instruction for both the bundle and manifest goals - however, because the
manifest goal doesn't
actually end up building the final bundle then you might find some minor
differences

but you can definitely use this to generate the Bundle-ClassPath even with
"war" packaging


> If I am using project type war and generate the manifest, the dependencies
> are not included a la Embed-Dependency.
>

yes, but you can configure Embed-Dependency to match the location the WAR
plugin uses

for example perhaps something like:

<configuration>
  <supportedProjectTypes>
    <supportedProjectType>jar</supportedProjectType>
    <supportedProjectType>bundle</supportedProjectType>
    <supportedProjectType>war</supportedProjectType>
  </supportedProjectTypes>
  <instructions>
    <Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>
    <Embed-Directory>WEB-INF/lib</Embed-Directory>
    <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
    <Embed-Transitive>true</Embed-Transitive>
    <Import-Package>*;resolution:=optional</Import-Package>
  </instructions>
</configuration>

Besides, the "correct" way to include dependencies in a WAR is not by usual
> maven-bundle-plugin conventions and definitely not by inlining, but by
> putting them in WEB-INF/lib, and this is handled by maven-war-plugin.
>
> Problem is, maven-war-plugin does not correctly add Bundle-ClassPath, and
> maven-bundle-plugin doesn't generate it either when not being "fully used"
>
> Maybe I'm missing the solution...
>

try the 1.4.3 version of the plugin - the manifest goal will process
Embed-Dependency


>
> Just some ideas for you...
>>
>> Thanks,
>> Chris
>>
>> --
>> Chris Custine
>> My Blog :: http://blog.organicelement.com
>> Apache ServiceMix :: http://servicemix.apache.org
>> Apache Directory Server :: http://directory.apache.org
>>
>>
>> On Fri, Oct 31, 2008 at 2:58 PM, Hendy Irawan <[EMAIL PROTECTED]>wrote:
>>
>>> In order to use Pax Web Extender War with "OSGi" WAR archives,
>>> Bundle-ClassPath must be set appropriately, *including *with a
>>> comma-separated list of every JAR in WEB-INF/lib ... When I have tens of
>>> JARs in that directory, this needs to be rethought. And doing this manually
>>> isn't robust.
>>>
>>> Is there a way to generate Bundle-ClassPath 'automatically' with regard
>>> to WAR-OSGi archives?
>>>
>>> Thank you.
>>>
>>> --
>>> Best regards,
>>> Hendy Irawan
>>> "Help save my best friend Melissa from teeth infection, please!" ->
>>> www.rainbowpurple.com
>>>
>>> _______________________________________________
>>> general mailing list
>>> general@lists.ops4j.org
>>> http://lists.ops4j.org/mailman/listinfo/general
>>>
>>>
>>
>> _______________________________________________
>> general mailing list
>> general@lists.ops4j.org
>> http://lists.ops4j.org/mailman/listinfo/general
>>
>>
>
>
> --
> Best regards,
> Hendy Irawan
> "Help save my best friend Melissa from teeth infection, please!" ->
> www.rainbowpurple.com
>
> _______________________________________________
> general mailing list
> general@lists.ops4j.org
> http://lists.ops4j.org/mailman/listinfo/general
>
>


-- 
Cheers, Stuart
_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to