You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Sahoo <Sa...@Sun.COM> on 2008/09/08 07:24:04 UTC
maven-bundle-plugin/bnd ignores micro component of version in
Import-Package
I am using maven-bundle-plugin v.1.4.3. I see that even though a bundle
exports 0.3.18 of a package, the Import-Package header only contains 0.3
as the version. I have attached a simple test case to bug #549 [1].
There is no packageversion file, so information is encoded in manifest
file only.
The relevant portion of generated manifest for both the artifacts are
given below:
A2/target/classes/META-INF/MANIFEST.MF
----------------------------------------------------------
Import-Package: p;version="0.3.18"
Export-Package: p;version="0.3.18"
A1/target/classes/META-INF/MANIFEST.MF
-----------------------------------------------------------
Import-Package: org.osgi.framework;version="1.3",p;version="0.3"
bnd document suggests that micro part should be used; only qualifiers
are dropped. Is this a bug in plugin or bnd? I need a fix/work around
rather soon.
Thanks,
Sahoo
[1] https://issues.apache.org/jira/browse/FELIX-549
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: maven-bundle-plugin/bnd ignores micro component of version in Import-Package
Posted by Peter Kriens <pe...@aqute.biz>.
You are right Stuart, the example is wrong. In the automatic case, the
micro part is dropped.
Kind regards,
Peter Kriens
On 9 sep 2008, at 02:57, Stuart McCulloch wrote:
> 2008/9/9 Sahoo <sa...@sun.com>
>
>> bnd documentation [1] says that it uses micro part of version.
>> Shown below
>> is relevant portion of the documentation:
>>
>> /During processing, bnd will attempt to find the exported version of
>> imported packages. If no version or version range is specified on
>> the import
>> instruction, the exported version will then be used though the
>> *micro* part
>> and the qualifier are dropped. That is, when the exporter is
>> |1.2.3.build123|, then the import version will be 1.2.3. If a
>> specific
>> version (range) is specified, this will override any found version.
>> However,
>> ${@} can be used to substitute the found version in a range. /
>>
>
> actually that does say the micro part *will* be dropped unless you
> specify
> an
> explicit version on the import - but the example shown keeps the
> micro part.
>
> I think the example on the BND website is wrong, and it should be
> "1.2", but
> hopefully Peter can clarify what is the expected result - looking at
> the
> code
> the micro part is definitely dropped on purpose...
>
>
>> Thanks,
>> Sahoo
>> [1] http://www.aqute.biz/Code/Bnd
>>
>>
>> Richard S. Hall wrote:
>>
>>> I think I remember Peter saying something about this. I think it
>>> is a
>>> "feature", trying to add some flexibility. I could be wrong.
>>>
>>> -> richard
>>>
>>> Sahoo wrote:
>>>
>>>> Stuart McCulloch wrote:
>>>>
>>>>> 2008/9/8 Sahoo <Sa...@sun.com>
>>>>>
>>>>> the simple workaround would be to manually fix the version to
>>>>> the micro
>>>>> level - but note
>>>>> that version="0.3" is short for version="[0.3,?)" which does
>>>>> include the
>>>>> "0.3.18" version
>>>>> so you might find that the trimmed version still works for you
>>>>>
>>>>> do you see any exceptions / problems when you use the bundle
>>>>> with the
>>>>> trimmed version?
>>>>>
>>>>>
>>>> Although trimmed version works for me, I am afraid that it will
>>>> match
>>>> with versions that I don't want it to. Ideally, a good version
>>>> management
>>>> policy (like micro version only for bug fixes) should have
>>>> avoided such
>>>> worries, but we don't have such a good policy enforced.
>>>>
>>>> Since this package is imported in a lot of files, it is rather
>>>> cumbersome
>>>> to fix all the poms to specify the version. Hence, I was looking
>>>> for a fix
>>>> to the plugin. Having said that, I understand if this can't be
>>>> fixed
>>>> immediately.
>>>>
>>>> Thanks,
>>>> Sahoo
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>
>
> --
> Cheers, Stuart
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: maven-bundle-plugin/bnd ignores micro component of version in Import-Package
Posted by Stuart McCulloch <mc...@gmail.com>.
2008/9/9 Sahoo <sa...@sun.com>
> bnd documentation [1] says that it uses micro part of version. Shown below
> is relevant portion of the documentation:
>
> /During processing, bnd will attempt to find the exported version of
> imported packages. If no version or version range is specified on the import
> instruction, the exported version will then be used though the *micro* part
> and the qualifier are dropped. That is, when the exporter is
> |1.2.3.build123|, then the import version will be 1.2.3. If a specific
> version (range) is specified, this will override any found version. However,
> ${@} can be used to substitute the found version in a range. /
>
actually that does say the micro part *will* be dropped unless you specify
an
explicit version on the import - but the example shown keeps the micro part.
I think the example on the BND website is wrong, and it should be "1.2", but
hopefully Peter can clarify what is the expected result - looking at the
code
the micro part is definitely dropped on purpose...
> Thanks,
> Sahoo
> [1] http://www.aqute.biz/Code/Bnd
>
>
> Richard S. Hall wrote:
>
>> I think I remember Peter saying something about this. I think it is a
>> "feature", trying to add some flexibility. I could be wrong.
>>
>> -> richard
>>
>> Sahoo wrote:
>>
>>> Stuart McCulloch wrote:
>>>
>>>> 2008/9/8 Sahoo <Sa...@sun.com>
>>>>
>>>> the simple workaround would be to manually fix the version to the micro
>>>> level - but note
>>>> that version="0.3" is short for version="[0.3,?)" which does include the
>>>> "0.3.18" version
>>>> so you might find that the trimmed version still works for you
>>>>
>>>> do you see any exceptions / problems when you use the bundle with the
>>>> trimmed version?
>>>>
>>>>
>>> Although trimmed version works for me, I am afraid that it will match
>>> with versions that I don't want it to. Ideally, a good version management
>>> policy (like micro version only for bug fixes) should have avoided such
>>> worries, but we don't have such a good policy enforced.
>>>
>>> Since this package is imported in a lot of files, it is rather cumbersome
>>> to fix all the poms to specify the version. Hence, I was looking for a fix
>>> to the plugin. Having said that, I understand if this can't be fixed
>>> immediately.
>>>
>>> Thanks,
>>> Sahoo
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
--
Cheers, Stuart
Re: maven-bundle-plugin/bnd ignores micro component of version in
Import-Package
Posted by Sahoo <sa...@sun.com>.
bnd documentation [1] says that it uses micro part of version. Shown
below is relevant portion of the documentation:
/During processing, bnd will attempt to find the exported version of
imported packages. If no version or version range is specified on the
import instruction, the exported version will then be used though the
*micro* part and the qualifier are dropped. That is, when the exporter
is |1.2.3.build123|, then the import version will be 1.2.3. If a
specific version (range) is specified, this will override any found
version. However, ${@} can be used to substitute the found version in a
range. /
Thanks,
Sahoo
[1] http://www.aqute.biz/Code/Bnd
Richard S. Hall wrote:
> I think I remember Peter saying something about this. I think it is a
> "feature", trying to add some flexibility. I could be wrong.
>
> -> richard
>
> Sahoo wrote:
>> Stuart McCulloch wrote:
>>> 2008/9/8 Sahoo <Sa...@sun.com>
>>>
>>>
>>> the simple workaround would be to manually fix the version to the micro
>>> level - but note
>>> that version="0.3" is short for version="[0.3,?)" which does include
>>> the
>>> "0.3.18" version
>>> so you might find that the trimmed version still works for you
>>>
>>> do you see any exceptions / problems when you use the bundle with the
>>> trimmed version?
>>>
>> Although trimmed version works for me, I am afraid that it will match
>> with versions that I don't want it to. Ideally, a good version
>> management policy (like micro version only for bug fixes) should have
>> avoided such worries, but we don't have such a good policy enforced.
>>
>> Since this package is imported in a lot of files, it is rather
>> cumbersome to fix all the poms to specify the version. Hence, I was
>> looking for a fix to the plugin. Having said that, I understand if
>> this can't be fixed immediately.
>>
>> Thanks,
>> Sahoo
>>
>> ---------------------------------------------------------------------
>> 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: maven-bundle-plugin/bnd ignores micro component of version in
Import-Package
Posted by Sahoo <sa...@sun.com>.
bnd documentation [1] says that it uses micro part of version. Shown
below is relevant portion of the documentation:
/During processing, bnd will attempt to find the exported version of
imported packages. If no version or version range is specified on the
import instruction, the exported version will then be used though the
*micro* part and the qualifier are dropped. That is, when the exporter
is |1.2.3.build123|, then the import version will be 1.2.3. If a
specific version (range) is specified, this will override any found
version. However, ${@} can be used to substitute the found version in a
range. /
Thanks,
Sahoo
[1] http://www.aqute.biz/Code/Bnd
Richard S. Hall wrote:
> I think I remember Peter saying something about this. I think it is a
> "feature", trying to add some flexibility. I could be wrong.
>
> -> richard
>
> Sahoo wrote:
>> Stuart McCulloch wrote:
>>> 2008/9/8 Sahoo <Sa...@sun.com>
>>>
>>>
>>> the simple workaround would be to manually fix the version to the micro
>>> level - but note
>>> that version="0.3" is short for version="[0.3,?)" which does include
>>> the
>>> "0.3.18" version
>>> so you might find that the trimmed version still works for you
>>>
>>> do you see any exceptions / problems when you use the bundle with the
>>> trimmed version?
>>>
>> Although trimmed version works for me, I am afraid that it will match
>> with versions that I don't want it to. Ideally, a good version
>> management policy (like micro version only for bug fixes) should have
>> avoided such worries, but we don't have such a good policy enforced.
>>
>> Since this package is imported in a lot of files, it is rather
>> cumbersome to fix all the poms to specify the version. Hence, I was
>> looking for a fix to the plugin. Having said that, I understand if
>> this can't be fixed immediately.
>>
>> Thanks,
>> Sahoo
>>
>> ---------------------------------------------------------------------
>> 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: maven-bundle-plugin/bnd ignores micro component of version in
Import-Package
Posted by "Richard S. Hall" <he...@ungoverned.org>.
I think I remember Peter saying something about this. I think it is a
"feature", trying to add some flexibility. I could be wrong.
-> richard
Sahoo wrote:
> Stuart McCulloch wrote:
>> 2008/9/8 Sahoo <Sa...@sun.com>
>>
>>
>> the simple workaround would be to manually fix the version to the micro
>> level - but note
>> that version="0.3" is short for version="[0.3,?)" which does include the
>> "0.3.18" version
>> so you might find that the trimmed version still works for you
>>
>> do you see any exceptions / problems when you use the bundle with the
>> trimmed version?
>>
> Although trimmed version works for me, I am afraid that it will match
> with versions that I don't want it to. Ideally, a good version
> management policy (like micro version only for bug fixes) should have
> avoided such worries, but we don't have such a good policy enforced.
>
> Since this package is imported in a lot of files, it is rather
> cumbersome to fix all the poms to specify the version. Hence, I was
> looking for a fix to the plugin. Having said that, I understand if
> this can't be fixed immediately.
>
> Thanks,
> Sahoo
>
> ---------------------------------------------------------------------
> 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-bundle-plugin/bnd ignores micro component of version in
Import-Package
Posted by Sahoo <Sa...@Sun.COM>.
Stuart McCulloch wrote:
> 2008/9/8 Sahoo <Sa...@sun.com>
>
>
>
> the simple workaround would be to manually fix the version to the micro
> level - but note
> that version="0.3" is short for version="[0.3,?)" which does include the
> "0.3.18" version
> so you might find that the trimmed version still works for you
>
> do you see any exceptions / problems when you use the bundle with the
> trimmed version?
>
Although trimmed version works for me, I am afraid that it will match
with versions that I don't want it to. Ideally, a good version
management policy (like micro version only for bug fixes) should have
avoided such worries, but we don't have such a good policy enforced.
Since this package is imported in a lot of files, it is rather
cumbersome to fix all the poms to specify the version. Hence, I was
looking for a fix to the plugin. Having said that, I understand if this
can't be fixed immediately.
Thanks,
Sahoo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: maven-bundle-plugin/bnd ignores micro component of version in Import-Package
Posted by Stuart McCulloch <mc...@gmail.com>.
2008/9/8 Sahoo <Sa...@sun.com>
> I am using maven-bundle-plugin v.1.4.3. I see that even though a bundle
> exports 0.3.18 of a package, the Import-Package header only contains 0.3 as
> the version. I have attached a simple test case to bug #549 [1]. There is no
> packageversion file, so information is encoded in manifest file only.
>
> The relevant portion of generated manifest for both the artifacts are given
> below:
>
> A2/target/classes/META-INF/MANIFEST.MF
> ----------------------------------------------------------
> Import-Package: p;version="0.3.18"
> Export-Package: p;version="0.3.18"
>
> A1/target/classes/META-INF/MANIFEST.MF
> -----------------------------------------------------------
> Import-Package: org.osgi.framework;version="1.3",p;version="0.3"
>
> bnd document suggests that micro part should be used; only qualifiers are
> dropped. Is this a bug in plugin or bnd? I need a fix/work around rather
> soon.
>
I'll need to dig into the BND source to confirm this is a bug (unless Peter
beats me to it)
also note that I'm still waiting for the latest version of BND to be
uploaded to the Maven
central repository (http://jira.codehaus.org/browse/MAVENUPLOAD-2187) for
the last
few weeks, and this update also brings in several other changes - so imho a
quick fix is
very unlikely what with time needed for testing, etc.
the simple workaround would be to manually fix the version to the micro
level - but note
that version="0.3" is short for version="[0.3,∞)" which does include the
"0.3.18" version
so you might find that the trimmed version still works for you
do you see any exceptions / problems when you use the bundle with the
trimmed version?
Thanks,
> Sahoo
>
> [1] https://issues.apache.org/jira/browse/FELIX-549
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
--
Cheers, Stuart