sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Schaefer <schaef...@me.com.INVALID>
Subject Re: Variables in Bundle Id inside Feature Model
Date Fri, 24 May 2019 15:11:33 GMT
Ok, that’s fine. I will change the PM to FM Converter so that variables inside the bundles
are replaced with the actual value.

- Andy

> On May 23, 2019, at 11:11 PM, Karl Pauls <karlpauls@gmail.com> wrote:
> 
> That said, maven properties can be used - hence, if you want to just have
> the version in one place in your build you can by using a maven property.
> 
> The difference is build time vs deploy/runtime.
> 
> regards,
> 
> Karl
> 
> On Friday, May 24, 2019, Carsten Ziegeler <cziegeler@apache.org> wrote:
> 
>> Hi,
>> 
>> variables are not supported for bundle ids by design. Reasoning behind
>> this is in the end reproducibility. A specific feature should be the same
>> everywhere. With variables in the ids it would be possible that different
>> artifacts are used in different situations for the same feature.
>> 
>> Now, the same argument would actually hold true for variables in
>> configurations and framework properties. However, its more common that a
>> configuration is tweaked.
>> 
>> Regards
>> 
>> Carsten
>> 
>> 
>> Andreas Schaefer wrote
>> 
>>> Hi
>>> 
>>> According to the FeatureBuilder:
>>> 
>>> /**
>>>  * Resolve variables in the feature.
>>>  * Variables are allowed in the values of framework properties and in
>>> the values of
>>>  * configuration properties.
>>>  * @param feature The feature
>>>  * @param additionalVariables Optional additional variables
>>>  */
>>> public static void resolveVariables(final Feature feature, final
>>> Map<String,String> additionalVariables) {
>>> 
>>> Variables are only allowed in framework and configuration properties. In
>>> the Provisioning Models of Sling (boot etc) variables are used for versions
>>> like slf4j.version.
>>> 
>>> Are variables not permitted inside bundle ids (fix inside the PM to FM
>>> Converter) or shall this be allowed where I will create a ticket for it for
>>> the Sling Feature module?
>>> 
>>> This is an excerpt of the boot_boot.json FM file converter with the PM to
>>> FM converter base on the boot.txt provision file from Sling:
>>> 
>>> {
>>>   "id":"${project.groupId}:${project.artifactId}:slingfeature
>>> :boot:${project.version}",
>>>   "variables":{
>>>     "slf4j.version":"1.7.25"
>>>   },
>>>   "bundles”:[
>>> …
>>>     {
>>>       "id":"org.slf4j:slf4j-api:${slf4j.version}",
>>>       "start-level":"1"
>>>     }
>>>   ],
>>> …
>>> 
>>> Cheers - Andy Schaefer
>>> 
>>> --
>> Carsten Ziegeler
>> Adobe Research Switzerland
>> cziegeler@apache.org
>> 
> 
> 
> -- 
> Karl Pauls
> karlpauls@gmail.com


Mime
View raw message