You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Yves Langisch <yv...@langisch.ch> on 2012/01/19 11:33:32 UTC

Environment variables in MANIFEST.MF

Hi,

I'm using the maven-bundle-plugin to create a bundle. Locally it works 
fine but on my Jenkins build server all environment variables (e.g. 
JAVA_HOME) are also added to the MANIFEST.MF. Is there any setting to 
prevent BND from doing that?

Thanks
Yves

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


Re: fake manifest entries : maven-bundle-plugin 2.3.5 -> 2.3.7

Posted by Andrei Pozolotin <an...@gmail.com>.
    Stuart:

    1) yes I was using this: "Are you using the bundle:manifest goal in
    a separate execution? "

    2)  <rebuildBundle> resolved my issue! :-)

    3) how can I customize bnd inside m2e?

    Thank you,

    Andrei



-------- Original Message  --------
Subject: Re: fake manifest entries : maven-bundle-plugin 2.3.5 -> 2.3.7
From: Stuart McCulloch <mc...@gmail.com>
To: users@felix.apache.org
Date: Mon 13 Feb 2012 11:52:56 AM CST
> On 13 Feb 2012, at 17:33, Andrei Pozolotin wrote:
>
>>    Stuart:
>>
>>    1) in my case I need to create fake bundle for felix embedder host;
>>    I am providing auto-generate an entry for
>>    org./osgi/.framework./system/./packages/./extra/
>>
>>    as follows:
>>
>>    1) use maven-bundle-plugin 2.3.5 with manual <Export-Package>
>>    entries with <_failok>true
>>    2) generate custom manifest from these entries at build time;
>>    3) load this custom manifest from jar at run time,
>>    4) dynamically generate
>>    org./osgi/.framework./system/./packages/./extra/ from custom
>>    manifest before felix start
>>
>>    the motivation for this is to use bnd to auto expand * wildcard
>>    package name spaces;
>>
>>    2) this is working fine in 2.3.5
>>
>>    3) now I am migrating to 2.3.6 / 2.3.7
>>    and I am getting the old error, which I did not see for some time
>>    for this use case:
>>    http://mail-archives.apache.org/mod_mbox/felix-users/200908.mbox/%3C81f0d9c0908240411x5b6f3574l8938e41b5135f8a7@mail.gmail.com%3E
>>
>>    4) does 2.3.6 / 2.3.7
>>    has some magic option to revert to 2.3.5 behaviour?
> Are you using the bundle:manifest goal in a separate execution? If so then it sounds like you're relying on broken behaviour in 2.3.5 where it always rebuilt the bundle in-memory for the manifest goal instead of using the attached file (which is what the manifest goal was originally expected to use before the incorrect change in 2.3.5). See https://issues.apache.org/jira/browse/FELIX-3206 and https://issues.apache.org/jira/browse/FELIX-2817 for more history.
>
> If you need to rebuild the bundle to properly calculate the manifest (say for example when the Maven attached file is unrelated to the manifest you're generating) then add <rebuildBundle>true</rebuildBundle> to the plugin configuration (note that it should go in the <configuration> part, not the <instructions> part).
>
> FYI, the changes in each release are recorded in the changelog.txt and the Maven site docs:
>
>    http://svn.apache.org/repos/asf/felix/releases/maven-bundle-plugin-2.3.6/doc/site/jira-report.html
>
> PS. feel free to attach an example project to JIRA so we can extend the tests if necessary.
>
>>    Thank you,
>>
>>    Andrei
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


Re: fake manifest entries : maven-bundle-plugin 2.3.5 -> 2.3.7

Posted by Stuart McCulloch <mc...@gmail.com>.
On 13 Feb 2012, at 17:33, Andrei Pozolotin wrote:

>    Stuart:
> 
>    1) in my case I need to create fake bundle for felix embedder host;
>    I am providing auto-generate an entry for
>    org./osgi/.framework./system/./packages/./extra/
> 
>    as follows:
> 
>    1) use maven-bundle-plugin 2.3.5 with manual <Export-Package>
>    entries with <_failok>true
>    2) generate custom manifest from these entries at build time;
>    3) load this custom manifest from jar at run time,
>    4) dynamically generate
>    org./osgi/.framework./system/./packages/./extra/ from custom
>    manifest before felix start
> 
>    the motivation for this is to use bnd to auto expand * wildcard
>    package name spaces;
> 
>    2) this is working fine in 2.3.5
> 
>    3) now I am migrating to 2.3.6 / 2.3.7
>    and I am getting the old error, which I did not see for some time
>    for this use case:
>    http://mail-archives.apache.org/mod_mbox/felix-users/200908.mbox/%3C81f0d9c0908240411x5b6f3574l8938e41b5135f8a7@mail.gmail.com%3E
> 
>    4) does 2.3.6 / 2.3.7
>    has some magic option to revert to 2.3.5 behaviour?

Are you using the bundle:manifest goal in a separate execution? If so then it sounds like you're relying on broken behaviour in 2.3.5 where it always rebuilt the bundle in-memory for the manifest goal instead of using the attached file (which is what the manifest goal was originally expected to use before the incorrect change in 2.3.5). See https://issues.apache.org/jira/browse/FELIX-3206 and https://issues.apache.org/jira/browse/FELIX-2817 for more history.

If you need to rebuild the bundle to properly calculate the manifest (say for example when the Maven attached file is unrelated to the manifest you're generating) then add <rebuildBundle>true</rebuildBundle> to the plugin configuration (note that it should go in the <configuration> part, not the <instructions> part).

FYI, the changes in each release are recorded in the changelog.txt and the Maven site docs:

   http://svn.apache.org/repos/asf/felix/releases/maven-bundle-plugin-2.3.6/doc/site/jira-report.html

PS. feel free to attach an example project to JIRA so we can extend the tests if necessary.

>    Thank you,
> 
>    Andrei
> 


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


fake manifest entries : maven-bundle-plugin 2.3.5 -> 2.3.7

Posted by Andrei Pozolotin <an...@gmail.com>.
    Stuart:

    1) in my case I need to create fake bundle for felix embedder host;
    I am providing auto-generate an entry for
    org./osgi/.framework./system/./packages/./extra/

    as follows:

    1) use maven-bundle-plugin 2.3.5 with manual <Export-Package>
    entries with <_failok>true
    2) generate custom manifest from these entries at build time;
    3) load this custom manifest from jar at run time,
    4) dynamically generate
    org./osgi/.framework./system/./packages/./extra/ from custom
    manifest before felix start

    the motivation for this is to use bnd to auto expand * wildcard
    package name spaces;

    2) this is working fine in 2.3.5

    3) now I am migrating to 2.3.6 / 2.3.7
    and I am getting the old error, which I did not see for some time
    for this use case:
    http://mail-archives.apache.org/mod_mbox/felix-users/200908.mbox/%3C81f0d9c0908240411x5b6f3574l8938e41b5135f8a7@mail.gmail.com%3E

    4) does 2.3.6 / 2.3.7
    has some magic option to revert to 2.3.5 behaviour?

    Thank you,

    Andrei


Re: Environment variables in MANIFEST.MF

Posted by Stuart McCulloch <mc...@gmail.com>.
On 13 Feb 2012, at 06:47, Tuomas Kiviaho wrote:

> Our CI environment seems to be running on an older version of maven (2.2.1).
> That might be the reason why I'm not seeing environment variables amongst
> execution properties, but I haven't confirmed this. My local builds with
> maven 3.x do not have this problem (environment variables seem to be
> prefixed with 'env.' amongst execution properties). 

I suspect the Maven2 CI job adds the current environment variables to the embedded Maven session, which is why this is seen in CI but not when building locally

> --
> Tuomas
> -- 
> View this message in context: http://old.nabble.com/Environment-variables-in-MANIFEST.MF-tp33166922p33313042.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> 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: Environment variables in MANIFEST.MF

Posted by Tuomas Kiviaho <tu...@iki.fi>.
Our CI environment seems to be running on an older version of maven (2.2.1).
That might be the reason why I'm not seeing environment variables amongst
execution properties, but I haven't confirmed this. My local builds with
maven 3.x do not have this problem (environment variables seem to be
prefixed with 'env.' amongst execution properties). 

--
Tuomas
-- 
View this message in context: http://old.nabble.com/Environment-variables-in-MANIFEST.MF-tp33166922p33313042.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


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


Re: Environment variables in MANIFEST.MF

Posted by Stuart McCulloch <mc...@gmail.com>.
On 10 Feb 2012, at 08:01, Tuomas Kiviaho wrote:
> I'm having the exact same problem. Any news what might cause this. I upgraded
> the bundle plugin from 2.0.1 to 2.3.6 and this started to appear.

See this thread http://www.mail-archive.com/users@felix.apache.org/msg11754.html for more discussion.

I tracked the cause down to https://issues.apache.org/jira/browse/FELIX-2449 which added the Maven session execution properties to the properties passed to bnd.
This change was needed so people could use command-line properties in bnd macros, otherwise you could get inconsistent results between Maven and bnd filtering.

Perhaps we should simply avoid adding any Maven session execution properties that start with an upper-case letter (bnd automatically copies these to the manifest).

Reminder: you can tell bnd to avoid copying entries to the manifest by listing the headers in the <_removeheaders> instruction.

> --
> Tuomas
> 
> 
> Yves Langisch-2 wrote:
>> 
>> Hi,
>> 
>> I'm using the maven-bundle-plugin to create a bundle. Locally it works 
>> fine but on my Jenkins build server all environment variables (e.g. 
>> JAVA_HOME) are also added to the MANIFEST.MF. Is there any setting to 
>> prevent BND from doing that?
>> 
>> Thanks
>> Yves
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>> 
>> 
> 
> -- 
> View this message in context: http://old.nabble.com/Environment-variables-in-MANIFEST.MF-tp33166922p33298652.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> 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: Environment variables in MANIFEST.MF

Posted by Stuart McCulloch <mc...@gmail.com>.
On 10 Feb 2012, at 08:01, Tuomas Kiviaho wrote:

> I'm having the exact same problem. Any news what might cause this. I upgraded
> the bundle plugin from 2.0.1 to 2.3.6 and this started to appear.

This is fixed in maven-bundle-plugin 2.3.7 which is now available from Maven central

> --
> Tuomas
> 
> 
> Yves Langisch-2 wrote:
>> 
>> Hi,
>> 
>> I'm using the maven-bundle-plugin to create a bundle. Locally it works 
>> fine but on my Jenkins build server all environment variables (e.g. 
>> JAVA_HOME) are also added to the MANIFEST.MF. Is there any setting to 
>> prevent BND from doing that?
>> 
>> Thanks
>> Yves
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>> 
>> 
> 
> -- 
> View this message in context: http://old.nabble.com/Environment-variables-in-MANIFEST.MF-tp33166922p33298652.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> 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: Environment variables in MANIFEST.MF

Posted by Tuomas Kiviaho <tu...@iki.fi>.
I'm having the exact same problem. Any news what might cause this. I upgraded
the bundle plugin from 2.0.1 to 2.3.6 and this started to appear.

--
Tuomas


Yves Langisch-2 wrote:
> 
> Hi,
> 
> I'm using the maven-bundle-plugin to create a bundle. Locally it works 
> fine but on my Jenkins build server all environment variables (e.g. 
> JAVA_HOME) are also added to the MANIFEST.MF. Is there any setting to 
> prevent BND from doing that?
> 
> Thanks
> Yves
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 
> 

-- 
View this message in context: http://old.nabble.com/Environment-variables-in-MANIFEST.MF-tp33166922p33298652.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


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