Re: Bundle-ClassPath without "." while using maven-bundle-plugin and maven-war-plugin together

2009-09-08 Thread Sahoo

Stuart McCulloch wrote:

feel free to attach your testcase to a JIRA issue (make sure it can be
built without missing dependencies, etc.) ... unfortunately I can't say
for sure when I'll be able to get round to actively look at it
  

Filed https://issues.apache.org/jira/browse/FELIX-1571.

Thanks,
Sahoo

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



Re: Bundle-ClassPath without "." while using maven-bundle-plugin and maven-war-plugin together

2009-09-07 Thread Sahoo

Stuart McCulloch wrote:

2009/6/13 Sahoo 

  

I am using a war type project, so the packaging is governed by
maven-war-plugin. For the OSGi meta data in the war, I am using manifest
goal of maven-bundle-plugin in process-classes phase. Yes, I have already
looked at the excellent examples on this use case at [1]. However, my use
case has one difference. I don't want "." in Bundle-ClassPath. Why? Because,
it should never be. Files at the root level of .war file is never used
directly by class loaders in web container; WEB-INF/classes and
WEB-INF/lib/*.jar are used instead. As soon as I remove the "." from
Bundle-ClassPath settings, bundle plugin is confused. I don't know why  "."
is necessary for bundle plugin to generate meta data? My guess is without
it, it does not find any classes in the target dir?




if you want to use the bundleplugin to build the WAR file then you need
to use Embed-Dependency (or the raw Bnd Include-Resouce instruction)
so that the classes end up in the right location(s) inside the WAR bundle
- then when Bnd analyzes the Bundle-ClassPath it will find the classes
  
I will explore this option, but let's focus on using war plugin to do 
the packaging and bundle plugin to generate the manifest.

if you want to use the bundleplugin to generate the manifest, and you
want a Bundle-ClassPath without '.' then I suspect you'll need to have
the WAR file laid out under "target/classes" (or somewhere else that
you could add to the Bnd classpath by using its -classpath setting)
  
In fact, war plugin already creates an exploded directory called 
target/${finalName}/ with the war content in it. I suspect it is created 
after bundle is run, so bundle plugin can't see the contents even if I 
appropriate set <_classpath/>.


Thanks,
Sahoo

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



Re: Bundle-ClassPath without "." while using maven-bundle-plugin and maven-war-plugin together

2009-06-14 Thread Stuart McCulloch
2009/6/13 Sahoo 

> I am using a war type project, so the packaging is governed by
> maven-war-plugin. For the OSGi meta data in the war, I am using manifest
> goal of maven-bundle-plugin in process-classes phase. Yes, I have already
> looked at the excellent examples on this use case at [1]. However, my use
> case has one difference. I don't want "." in Bundle-ClassPath. Why? Because,
> it should never be. Files at the root level of .war file is never used
> directly by class loaders in web container; WEB-INF/classes and
> WEB-INF/lib/*.jar are used instead. As soon as I remove the "." from
> Bundle-ClassPath settings, bundle plugin is confused. I don't know why  "."
> is necessary for bundle plugin to generate meta data? My guess is without
> it, it does not find any classes in the target dir?


if you want to use the bundleplugin to build the WAR file then you need
to use Embed-Dependency (or the raw Bnd Include-Resouce instruction)
so that the classes end up in the right location(s) inside the WAR bundle
- then when Bnd analyzes the Bundle-ClassPath it will find the classes

if you want to use the bundleplugin to generate the manifest, and you
want a Bundle-ClassPath without '.' then I suspect you'll need to have
the WAR file laid out under "target/classes" (or somewhere else that
you could add to the Bnd classpath by using its -classpath setting)

otherwise I suspect the reason you're getting unexpected results is
because Bnd is looking for the given structure, but the classpath it's
been given is just the basic compilation path.

also the key difference between the bundle and manifest goals is that
the manifest goal doesn't actually generate the bundle, so there may
still be some inconsistencies due to this (and some may be impossible
to solve without actually generating the bundle - in which case you'd
might as well use the bundle goal and then extract the manifest...)

feel free to attach your testcase to a JIRA issue (make sure it can be
built without missing dependencies, etc.) ... unfortunately I can't say
for sure when I'll be able to get round to actively look at it

So, as a work around, I am having to specify Bundle-ClassPath using
> maven-war-plugin. Here is how plugin section of my pom.xml finally looks
> like:
>
>   
>   
>   maven-war-plugin
>   org.apache.maven.plugins
>   2.0
>   
>   
>   
>
> ${project.build.outputDirectory}/META-INF/MANIFEST.MF
>   
>   
>
> WEB-INF/classes/
>   
>   
>   
>   
>   
>   org.apache.felix
>   maven-bundle-plugin
>   2.0.0
>   
>   
>   jar
>   bundle
>   war
>   
>   
>
> sahoo.hybridapp.example1.impl.Activator
>
> sahoo.hybridapp.example1
>   /hybrid1
>   
>   
>   
>   
>   
>   bundle-manifest
>   process-classes
>   
>   manifest
>   
>   
>   
>   
>   
>
> Is there any better way to handle this? Right now it is OK as I have only
> WEB-INF/classes as classpath entry, but when I have jars in WEB-INF/lib, it
> becomes a maintenance issue.
>
> Thanks,
> Sahoo
>
> [1]
> http://wiki.ops4j.org/display/ops4j/Getting+the+benefits+of+maven-bundle-plugin+in+other+project+types
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>


-- 
Cheers, Stuart


Bundle-ClassPath without "." while using maven-bundle-plugin and maven-war-plugin together

2009-06-13 Thread Sahoo
I am using a war type project, so the packaging is governed by 
maven-war-plugin. For the OSGi meta data in the war, I am using manifest 
goal of maven-bundle-plugin in process-classes phase. Yes, I have 
already looked at the excellent examples on this use case at [1]. 
However, my use case has one difference. I don't want "." in 
Bundle-ClassPath. Why? Because, it should never be. Files at the root 
level of .war file is never used directly by class loaders in web 
container; WEB-INF/classes and WEB-INF/lib/*.jar are used instead. As 
soon as I remove the "." from Bundle-ClassPath settings, bundle plugin 
is confused. I don't know why  "." is necessary for bundle plugin to 
generate meta data? My guess is without it, it does not find any classes 
in the target dir? So, as a work around, I am having to specify 
Bundle-ClassPath using maven-war-plugin. Here is how plugin section of 
my pom.xml finally looks like:


   
   
   maven-war-plugin
   org.apache.maven.plugins
   2.0
   
   
   
   
${project.build.outputDirectory}/META-INF/MANIFEST.MF
   
   
   
WEB-INF/classes/

   
   
   
   
   
   org.apache.felix
   maven-bundle-plugin
   2.0.0
   
   
   jar
   bundle
   war
   
   
   
sahoo.hybridapp.example1.impl.Activator
   
sahoo.hybridapp.example1

   /hybrid1
   
   
   
   
   
   bundle-manifest
   process-classes
   
   manifest
   
   
   
   
   

Is there any better way to handle this? Right now it is OK as I have 
only WEB-INF/classes as classpath entry, but when I have jars in 
WEB-INF/lib, it becomes a maintenance issue.


Thanks,
Sahoo

[1] 
http://wiki.ops4j.org/display/ops4j/Getting+the+benefits+of+maven-bundle-plugin+in+other+project+types


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