You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Henri Gomez <he...@gmail.com> on 2009/01/27 12:24:10 UTC

maven / osgi / repositories

Hi to all,

We're using maven to build all our company projects for about 6 months
and are very happy with it.
Some of our projects, mainly Eclipse RCP plugins, are also mavenized.

We know think about OSGIfing more of our projects (server side) and
track ASF projects Felix of course core but also ServiceMix Kernel.

BTW, we wonder if there is a consensus or strategy about OSGIfied
artifacts and their location in external repositories.

- Should we repackage our current projects to produce both jar and plugins ?

- How and where to store these artifacts to make sure Felix could get
it (did a Nexus repository could do the job).

- How to 'mark' artifacts to indicate the difference between strict
jar and OSIG jars (bundles). Eclipse prefix then with org.eclipse, SS
with com.springsource ?


Advices and experience are more than welcome.

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


Re: maven / osgi / repositories

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Luke Patterson wrote:
> On Thu, Jan 29, 2009 at 3:10 PM, Richard S. Hall <he...@ungoverned.org> wrote:
>   
>> Patrick Forhan wrote:
>>     
>>> Note that a bundle is simply a JAR file with extra metadata.  A
>>> non-osgi container can use them as-is.  To that end, when we have
>>> bundles that end up on a server, we simply leave them as bundles and
>>> add them to the classpath or WAR, etc that is deployed.
>>>
>>>       
>> Keep in mind that a normal JAR file is always a bundle, but a bundle is not
>> always a normal JAR file. If you embed JAR files or native libraries in your
>> bundle, then you cannot use it as a normal JAR file.
>>
>>     
>
> If you add the same JARs that are embedded to the assembly, it should
> work fine right?  Granted, you would have bloat with the duplication,
> but the mere presence of embedded JARs wouldn't prevent running in
> non-OSGi, correct?
>   

That is correct...you'd have to manually resolve any dependencies it has 
from its Bundle-ClassPath or Bundle-NativeLibrary.

-> richard

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


Re: maven / osgi / repositories

Posted by Luke Patterson <lu...@gmail.com>.
On Thu, Jan 29, 2009 at 3:10 PM, Richard S. Hall <he...@ungoverned.org> wrote:
> Patrick Forhan wrote:
>>
>> Note that a bundle is simply a JAR file with extra metadata.  A
>> non-osgi container can use them as-is.  To that end, when we have
>> bundles that end up on a server, we simply leave them as bundles and
>> add them to the classpath or WAR, etc that is deployed.
>>
>
> Keep in mind that a normal JAR file is always a bundle, but a bundle is not
> always a normal JAR file. If you embed JAR files or native libraries in your
> bundle, then you cannot use it as a normal JAR file.
>

If you add the same JARs that are embedded to the assembly, it should
work fine right?  Granted, you would have bloat with the duplication,
but the mere presence of embedded JARs wouldn't prevent running in
non-OSGi, correct?

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


Re: maven / osgi / repositories

Posted by Henri Gomez <he...@gmail.com>.
I play with maven-bundle-plugin and used Embed-Dependency to bundle
from an existing jar :)




2009/1/29 Richard S. Hall <he...@ungoverned.org>:
> Patrick Forhan wrote:
>>
>> On Thu, Jan 29, 2009 at 3:10 PM, Richard S. Hall <he...@ungoverned.org>
>> wrote:
>>
>>>
>>> Keep in mind that a normal JAR file is always a bundle, but a bundle is
>>> not
>>> always a normal JAR file. If you embed JAR files or native libraries in
>>> your
>>> bundle, then you cannot use it as a normal JAR file.
>>>
>>
>> Can you clarify?  I assume you mean that osgi is doing a little bit of
>> magic with respect to embedded JARs and native libraries, so you can't
>> use those portions straight up.  But they are still jar files, with a
>> jar-manifest, classes where java expects them (except in the embedded
>> JAR case), and so on.
>>
>
> If you embed JAR files in your bundle (and they are on your
> Bundle-ClassPath), then OSGi automatically makes them available to your
> bundle for class loading. Putting this bundle on the class path would result
> in class loading failures because it would no longer have access to its
> required bundle class path elements.
>
>> I haven't had a whole lot of luck with plain jar files as bundles,
>> I'll have to read up in the spec how they are to be treated.
>>
>
> Yeah, you can install a normal JAR file, but it isn't very useful. The only
> thing you can really do with it is use Bundle.loadClass(),
> Bundle.getResource(), etc. to load stuff out of it.
>
> -> richard
>>
>> Pat.
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

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


Re: maven / osgi / repositories

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Patrick Forhan wrote:
> On Thu, Jan 29, 2009 at 3:10 PM, Richard S. Hall <he...@ungoverned.org> wrote:
>   
>> Keep in mind that a normal JAR file is always a bundle, but a bundle is not
>> always a normal JAR file. If you embed JAR files or native libraries in your
>> bundle, then you cannot use it as a normal JAR file.
>>     
>
> Can you clarify?  I assume you mean that osgi is doing a little bit of
> magic with respect to embedded JARs and native libraries, so you can't
> use those portions straight up.  But they are still jar files, with a
> jar-manifest, classes where java expects them (except in the embedded
> JAR case), and so on.
>   

If you embed JAR files in your bundle (and they are on your 
Bundle-ClassPath), then OSGi automatically makes them available to your 
bundle for class loading. Putting this bundle on the class path would 
result in class loading failures because it would no longer have access 
to its required bundle class path elements.

> I haven't had a whole lot of luck with plain jar files as bundles,
> I'll have to read up in the spec how they are to be treated.
>   

Yeah, you can install a normal JAR file, but it isn't very useful. The 
only thing you can really do with it is use Bundle.loadClass(), 
Bundle.getResource(), etc. to load stuff out of it.

-> richard
> Pat.
>
>   

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


Re: maven / osgi / repositories

Posted by Patrick Forhan <fe...@muddyhorse.com>.
On Thu, Jan 29, 2009 at 3:10 PM, Richard S. Hall <he...@ungoverned.org> wrote:
> Keep in mind that a normal JAR file is always a bundle, but a bundle is not
> always a normal JAR file. If you embed JAR files or native libraries in your
> bundle, then you cannot use it as a normal JAR file.

Can you clarify?  I assume you mean that osgi is doing a little bit of
magic with respect to embedded JARs and native libraries, so you can't
use those portions straight up.  But they are still jar files, with a
jar-manifest, classes where java expects them (except in the embedded
JAR case), and so on.

I haven't had a whole lot of luck with plain jar files as bundles,
I'll have to read up in the spec how they are to be treated.

Pat.

-- 
Defy mediocrity.

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


Re: maven / osgi / repositories

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Patrick Forhan wrote:
> Note that a bundle is simply a JAR file with extra metadata.  A
> non-osgi container can use them as-is.  To that end, when we have
> bundles that end up on a server, we simply leave them as bundles and
> add them to the classpath or WAR, etc that is deployed.
>   

Keep in mind that a normal JAR file is always a bundle, but a bundle is 
not always a normal JAR file. If you embed JAR files or native libraries 
in your bundle, then you cannot use it as a normal JAR file.

-> richard
> Pat.
>
> On Tue, Jan 27, 2009 at 5:24 AM, Henri Gomez <he...@gmail.com> wrote:
>   
>> Hi to all,
>>
>> We're using maven to build all our company projects for about 6 months
>> and are very happy with it.
>> Some of our projects, mainly Eclipse RCP plugins, are also mavenized.
>>
>> We know think about OSGIfing more of our projects (server side) and
>> track ASF projects Felix of course core but also ServiceMix Kernel.
>>
>> BTW, we wonder if there is a consensus or strategy about OSGIfied
>> artifacts and their location in external repositories.
>>
>> - Should we repackage our current projects to produce both jar and plugins ?
>>
>> - How and where to store these artifacts to make sure Felix could get
>> it (did a Nexus repository could do the job).
>>
>> - How to 'mark' artifacts to indicate the difference between strict
>> jar and OSIG jars (bundles). Eclipse prefix then with org.eclipse, SS
>> with com.springsource ?
>>
>>
>> Advices and experience are more than welcome.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>>     
>
>
>
>   

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


Re: maven / osgi / repositories

Posted by Patrick Forhan <fe...@muddyhorse.com>.
Note that a bundle is simply a JAR file with extra metadata.  A
non-osgi container can use them as-is.  To that end, when we have
bundles that end up on a server, we simply leave them as bundles and
add them to the classpath or WAR, etc that is deployed.

Pat.

On Tue, Jan 27, 2009 at 5:24 AM, Henri Gomez <he...@gmail.com> wrote:
> Hi to all,
>
> We're using maven to build all our company projects for about 6 months
> and are very happy with it.
> Some of our projects, mainly Eclipse RCP plugins, are also mavenized.
>
> We know think about OSGIfing more of our projects (server side) and
> track ASF projects Felix of course core but also ServiceMix Kernel.
>
> BTW, we wonder if there is a consensus or strategy about OSGIfied
> artifacts and their location in external repositories.
>
> - Should we repackage our current projects to produce both jar and plugins ?
>
> - How and where to store these artifacts to make sure Felix could get
> it (did a Nexus repository could do the job).
>
> - How to 'mark' artifacts to indicate the difference between strict
> jar and OSIG jars (bundles). Eclipse prefix then with org.eclipse, SS
> with com.springsource ?
>
>
> Advices and experience are more than welcome.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>



-- 
Defy mediocrity.

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