You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Forrest Xia <fo...@gmail.com> on 2011/03/02 16:52:26 UTC

Why convert OSGi version when building an eba module ID?

Hi,

Anyone could explain to me why need this piece of code? why not directly use
OSGi version in the module ID?

public class BundleUtil {

   ...

    public static String getVersion(org.osgi.framework.
Version version) {
        String str = version.getMajor() + "." + version.getMinor() + "." +
version.getMicro();
        String qualifier = version.getQualifier();
        if (qualifier != null && qualifier.trim().length() > 0) {
            str += "-" + version.getQualifier().trim();
        }
        return str;
    }

The piece of code convert OSGi version into traditional maven-like version,
I want to know why do this transformation.

One of my concern is when I use geronimo-maven-plugin to deploy and undeploy
an eba, I need to manually specify the eba's Application-Version, then tell
geronimo-maven-plugin the exact module ID to undeploy it. But I want to use
maven property replacement to describe the module ID automatically. Can I do
that? Please advise. thanks!

Forrest

Re: Why convert OSGi version when building an eba module ID?

Posted by Forrest Xia <fo...@gmail.com>.
David,

Thank you for your explanation, it's really helpful for me to understand the
issue.

I also don't think it's a good idea that putting OSGi artifacts and Java EE
artifacts together in a same repository, because it will make user confusion
around from time to time.

On the other hand, the version change chain: maven-style(3.0-SNAPSHOT) ->
osgi-style(3.0.0.SNAPSHOT) -> maven-style(3.0.0-SNAPSHOT) is not a circle,
thus make dev/build/test configuration hard and confusion.

Maybe we can change our trunk version to 3.0.0-SNAPSHOT to make the
conversion circle, but it is just a tactical way, not a final resolution
about clearing up the co-existing of osgi and java ee artifacts.

Forrest

On Thu, Mar 3, 2011 at 1:59 AM, David Jencks <da...@yahoo.com> wrote:

> I think the reasoning here is that we are putting the eba into a
> maven-style repository so we need a maven-style version.
>
> In principle, putting the eba into our repo is a mistake.  osgi doesn't
> need us to put bundles in our repo, there shouldn't really be anything we
> need to do to put the eba in.  The problem comes from any expectations we
> might have that deploying an eba should persist over an osgi framework clean
> start.  I don't yet have any firm opinion on what to do about this.  I'm
> inclined to think that we shouldn't try to second-guess osgi and that some
> ways of installing bundles will be persistent and some ways won't be
> persistent and that is just fine.
>
> There are also some reasons we put the eba into our repo based on current
> deployer code but I suspect we can fix those soon.
>
> thanks
> david jencks
>
> On Mar 2, 2011, at 8:28 AM, Forrest Xia wrote:
>
> The patch of jira 5427 is to convert maven-like version to OSGi-like
> version, while my question is about why not using OSGi-like version directly
> in the module ID for a deployed eba module?
>
> Forrest
>
> On Thu, Mar 3, 2011 at 12:14 AM, Shawn Jiang <ge...@gmail.com> wrote:
>
>> See https://issues.apache.org/jira/browse/GERONIMO-5427 for the
>> background.
>>
>>
>> On Wed, Mar 2, 2011 at 11:52 PM, Forrest Xia <fo...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> Anyone could explain to me why need this piece of code? why not directly
>>> use OSGi version in the module ID?
>>>
>>> public class BundleUtil {
>>>
>>>    ...
>>>
>>>     public static String getVersion(org.osgi.framework.
>>> Version version) {
>>>         String str = version.getMajor() + "." + version.getMinor() + "."
>>> + version.getMicro();
>>>         String qualifier = version.getQualifier();
>>>         if (qualifier != null && qualifier.trim().length() > 0) {
>>>             str += "-" + version.getQualifier().trim();
>>>         }
>>>         return str;
>>>     }
>>>
>>> The piece of code convert OSGi version into traditional maven-like
>>> version, I want to know why do this transformation.
>>>
>>> One of my concern is when I use geronimo-maven-plugin to deploy and
>>> undeploy an eba, I need to manually specify the eba's Application-Version,
>>> then tell geronimo-maven-plugin the exact module ID to undeploy it. But I
>>> want to use maven property replacement to describe the module ID
>>> automatically. Can I do that? Please advise. thanks!
>>>
>>> Forrest
>>>
>>
>>
>>
>> --
>> Shawn
>>
>
>
>

Re: Why convert OSGi version when building an eba module ID?

Posted by David Jencks <da...@yahoo.com>.
I think the reasoning here is that we are putting the eba into a maven-style repository so we need a maven-style version.

In principle, putting the eba into our repo is a mistake.  osgi doesn't need us to put bundles in our repo, there shouldn't really be anything we need to do to put the eba in.  The problem comes from any expectations we might have that deploying an eba should persist over an osgi framework clean start.  I don't yet have any firm opinion on what to do about this.  I'm inclined to think that we shouldn't try to second-guess osgi and that some ways of installing bundles will be persistent and some ways won't be persistent and that is just fine.

There are also some reasons we put the eba into our repo based on current deployer code but I suspect we can fix those soon.

thanks
david jencks

On Mar 2, 2011, at 8:28 AM, Forrest Xia wrote:

> The patch of jira 5427 is to convert maven-like version to OSGi-like version, while my question is about why not using OSGi-like version directly in the module ID for a deployed eba module?
> 
> Forrest
> 
> On Thu, Mar 3, 2011 at 12:14 AM, Shawn Jiang <ge...@gmail.com> wrote:
> See https://issues.apache.org/jira/browse/GERONIMO-5427 for the background.
> 
> 
> On Wed, Mar 2, 2011 at 11:52 PM, Forrest Xia <fo...@gmail.com> wrote:
> Hi,
> 
> Anyone could explain to me why need this piece of code? why not directly use OSGi version in the module ID?
> 
> public class BundleUtil {
>     
>    ...
> 
>     public static String getVersion(org.osgi.framework.
> Version version) {
>         String str = version.getMajor() + "." + version.getMinor() + "." + version.getMicro();
>         String qualifier = version.getQualifier();
>         if (qualifier != null && qualifier.trim().length() > 0) {
>             str += "-" + version.getQualifier().trim();
>         }
>         return str;
>     }
> 
> The piece of code convert OSGi version into traditional maven-like version, I want to know why do this transformation.
> 
> One of my concern is when I use geronimo-maven-plugin to deploy and undeploy an eba, I need to manually specify the eba's Application-Version, then tell geronimo-maven-plugin the exact module ID to undeploy it. But I want to use maven property replacement to describe the module ID automatically. Can I do that? Please advise. thanks!
> 
> Forrest
> 
> 
> 
> -- 
> Shawn
> 


Re: Why convert OSGi version when building an eba module ID?

Posted by Forrest Xia <fo...@gmail.com>.
The patch of jira 5427 is to convert maven-like version to OSGi-like
version, while my question is about why not using OSGi-like version directly
in the module ID for a deployed eba module?

Forrest

On Thu, Mar 3, 2011 at 12:14 AM, Shawn Jiang <ge...@gmail.com> wrote:

> See https://issues.apache.org/jira/browse/GERONIMO-5427 for the
> background.
>
>
> On Wed, Mar 2, 2011 at 11:52 PM, Forrest Xia <fo...@gmail.com> wrote:
>
>> Hi,
>>
>> Anyone could explain to me why need this piece of code? why not directly
>> use OSGi version in the module ID?
>>
>> public class BundleUtil {
>>
>>    ...
>>
>>     public static String getVersion(org.osgi.framework.
>> Version version) {
>>         String str = version.getMajor() + "." + version.getMinor() + "." +
>> version.getMicro();
>>         String qualifier = version.getQualifier();
>>         if (qualifier != null && qualifier.trim().length() > 0) {
>>             str += "-" + version.getQualifier().trim();
>>         }
>>         return str;
>>     }
>>
>> The piece of code convert OSGi version into traditional maven-like
>> version, I want to know why do this transformation.
>>
>> One of my concern is when I use geronimo-maven-plugin to deploy and
>> undeploy an eba, I need to manually specify the eba's Application-Version,
>> then tell geronimo-maven-plugin the exact module ID to undeploy it. But I
>> want to use maven property replacement to describe the module ID
>> automatically. Can I do that? Please advise. thanks!
>>
>> Forrest
>>
>
>
>
> --
> Shawn
>

Re: Why convert OSGi version when building an eba module ID?

Posted by Shawn Jiang <ge...@gmail.com>.
See https://issues.apache.org/jira/browse/GERONIMO-5427 for the background.

On Wed, Mar 2, 2011 at 11:52 PM, Forrest Xia <fo...@gmail.com> wrote:

> Hi,
>
> Anyone could explain to me why need this piece of code? why not directly
> use OSGi version in the module ID?
>
> public class BundleUtil {
>
>    ...
>
>     public static String getVersion(org.osgi.framework.
> Version version) {
>         String str = version.getMajor() + "." + version.getMinor() + "." +
> version.getMicro();
>         String qualifier = version.getQualifier();
>         if (qualifier != null && qualifier.trim().length() > 0) {
>             str += "-" + version.getQualifier().trim();
>         }
>         return str;
>     }
>
> The piece of code convert OSGi version into traditional maven-like version,
> I want to know why do this transformation.
>
> One of my concern is when I use geronimo-maven-plugin to deploy and
> undeploy an eba, I need to manually specify the eba's Application-Version,
> then tell geronimo-maven-plugin the exact module ID to undeploy it. But I
> want to use maven property replacement to describe the module ID
> automatically. Can I do that? Please advise. thanks!
>
> Forrest
>



-- 
Shawn