You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by koch <ma...@averbis.com> on 2020/11/19 14:39:49 UTC
Feature XMLs
Hi
i have build a feature.xml that represents my example1 feature: (I have
used the karaf-maven-plugin to generate this)
The feature includes just one bundle.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0"
name="example1-feature">
<feature name="example1-feature" description="example1-feature"
version="1.0.0">
<details>Example1 Feature</details>
<bundle>mvn:de......examples/example0-bundle/1.0.0</bundle>
</feature>
</features>
now i have build a second example feature that needs the example1
feature to be installed.
The feature includes example1 and a bundle.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0"
name="example2-feature">
<repository>mvn:de.......examples/example1-feature/1.0.0/xml/features</repository>
<feature name="example1-feature" description="example1-feature"
version="1.0.0">
<details>Example2 Feature</details>
<feature version="1.0.0" prerequisite="false"
dependency="false">example1-feature</feature>
<feature prerequisite="true" dependency="false">wrap</feature>
<bundle>wrap:mvn:de......plugin.examples/example2-plugin/1.0.0</bundle>
</feature>
</features>
When i want to build a kar file i get an error because the 'wrap'
feature is not installed.
Why is the bundle of the second example wrapper with this wrap feature?
What does 'wrap:' mean?
Are my feature.xml files incorrect?
Why is the first bundle without wrap but the second bundle has this
wrapped thing?
Any help would be greatly appreciated
Kind regards,
Matthias
Re: Feature XMLs
Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
Hi,
Wrap is a protocol that "translate" a regular jar as an OSGi bundle at runtime.
So, you need wrap in your feature if you use non bundle jar.
Wrap is provided by the standard features repository.
So, if your example0-bundle is really a bundle (meaning that you have the OSGi headers in the MANIFEST), you don’t need wrap.
If you need wrap (it seems to be the case as example2-plugin is not a bundle), you need the wrap feature. This feature is provided by the Karaf standard features repository.
So, you have either to add standard features repo in <repository/> tag, or add this feature repo in your pom where you create the kar.
NB: it’s always better to create the features XML by hand (more efficient).
Regards
JB
> Le 19 nov. 2020 à 15:39, koch <ma...@averbis.com> a écrit :
>
> Hi
>
> i have build a feature.xml that represents my example1 feature: (I have used the karaf-maven-plugin to generate this)
> The feature includes just one bundle.
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="example1-feature">
> <feature name="example1-feature" description="example1-feature" version="1.0.0">
> <details>Example1 Feature</details>
> <bundle>mvn:de......examples/example0-bundle/1.0.0</bundle>
> </feature>
> </features>
>
> now i have build a second example feature that needs the example1 feature to be installed.
> The feature includes example1 and a bundle.
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="example2-feature">
> <repository>mvn:de.......examples/example1-feature/1.0.0/xml/features</repository>
> <feature name="example1-feature" description="example1-feature" version="1.0.0">
> <details>Example2 Feature</details>
> <feature version="1.0.0" prerequisite="false" dependency="false">example1-feature</feature>
> <feature prerequisite="true" dependency="false">wrap</feature>
> <bundle>wrap:mvn:de......plugin.examples/example2-plugin/1.0.0</bundle>
> </feature>
> </features>
>
> When i want to build a kar file i get an error because the 'wrap' feature is not installed.
>
> Why is the bundle of the second example wrapper with this wrap feature?
> What does 'wrap:' mean?
> Are my feature.xml files incorrect?
> Why is the first bundle without wrap but the second bundle has this wrapped thing?
>
> Any help would be greatly appreciated
>
> Kind regards,
> Matthias
>
Re: Feature XMLs
Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
You are welcome.
Don’t hesitate to ping if you need help ;)
Regards
JB
> Le 19 nov. 2020 à 17:01, koch <ma...@averbis.com> a écrit :
>
> Thanks for the quick support Jean.
> Keep up the good work. :)
>
> On 19.11.20 16:01, koch wrote:
>> Ok i think i have it now.
>>
>> wrap is needed for jars that are no bundle. I forgot the packaging 'bundle' in the dependency, so it was automatically wrapped.
>>
>> Does this make sense?
>>
>> On 19.11.20 15:39, koch wrote:
>>> Hi
>>>
>>> i have build a feature.xml that represents my example1 feature: (I have used the karaf-maven-plugin to generate this)
>>> The feature includes just one bundle.
>>>
>>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>>> <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="example1-feature">
>>> <feature name="example1-feature" description="example1-feature" version="1.0.0">
>>> <details>Example1 Feature</details>
>>> <bundle>mvn:de......examples/example0-bundle/1.0.0</bundle>
>>> </feature>
>>> </features>
>>>
>>> now i have build a second example feature that needs the example1 feature to be installed.
>>> The feature includes example1 and a bundle.
>>>
>>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>>> <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="example2-feature">
>>> <repository>mvn:de.......examples/example1-feature/1.0.0/xml/features</repository>
>>> <feature name="example1-feature" description="example1-feature" version="1.0.0">
>>> <details>Example2 Feature</details>
>>> <feature version="1.0.0" prerequisite="false" dependency="false">example1-feature</feature>
>>> <feature prerequisite="true" dependency="false">wrap</feature>
>>> <bundle>wrap:mvn:de......plugin.examples/example2-plugin/1.0.0</bundle>
>>> </feature>
>>> </features>
>>>
>>> When i want to build a kar file i get an error because the 'wrap' feature is not installed.
>>>
>>> Why is the bundle of the second example wrapper with this wrap feature?
>>> What does 'wrap:' mean?
>>> Are my feature.xml files incorrect?
>>> Why is the first bundle without wrap but the second bundle has this wrapped thing?
>>>
>>> Any help would be greatly appreciated
>>>
>>> Kind regards,
>>> Matthias
>>>
> --
> Matthias Koch
> Developer
>
> Averbis GmbH
> Salzstraße 15
> 79098 Freiburg
> Germany
>
> Fon: +49 761 708 394 21
> Fax: +49 761 708 394 10
> Email: matthias.koch@averbis.com
> Web: https://averbis.com
>
> Headquarters: Freiburg im Breisgau
> Register Court: Amtsgericht Freiburg im Breisgau, HRB 701080
> Managing Directors: Dr. med. Philipp Daumke, Dr. Kornél Markó
>
Re: Feature XMLs
Posted by koch <ma...@averbis.com>.
Thanks for the quick support Jean.
Keep up the good work. :)
On 19.11.20 16:01, koch wrote:
> Ok i think i have it now.
>
> wrap is needed for jars that are no bundle. I forgot the packaging
> 'bundle' in the dependency, so it was automatically wrapped.
>
> Does this make sense?
>
> On 19.11.20 15:39, koch wrote:
>> Hi
>>
>> i have build a feature.xml that represents my example1 feature: (I
>> have used the karaf-maven-plugin to generate this)
>> The feature includes just one bundle.
>>
>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>> <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0"
>> name="example1-feature">
>> <feature name="example1-feature" description="example1-feature"
>> version="1.0.0">
>> <details>Example1 Feature</details>
>> <bundle>mvn:de......examples/example0-bundle/1.0.0</bundle>
>> </feature>
>> </features>
>>
>> now i have build a second example feature that needs the example1
>> feature to be installed.
>> The feature includes example1 and a bundle.
>>
>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>> <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0"
>> name="example2-feature">
>> <repository>mvn:de.......examples/example1-feature/1.0.0/xml/features</repository>
>>
>> <feature name="example1-feature" description="example1-feature"
>> version="1.0.0">
>> <details>Example2 Feature</details>
>> <feature version="1.0.0" prerequisite="false"
>> dependency="false">example1-feature</feature>
>> <feature prerequisite="true" dependency="false">wrap</feature>
>> <bundle>wrap:mvn:de......plugin.examples/example2-plugin/1.0.0</bundle>
>> </feature>
>> </features>
>>
>> When i want to build a kar file i get an error because the 'wrap'
>> feature is not installed.
>>
>> Why is the bundle of the second example wrapper with this wrap feature?
>> What does 'wrap:' mean?
>> Are my feature.xml files incorrect?
>> Why is the first bundle without wrap but the second bundle has this
>> wrapped thing?
>>
>> Any help would be greatly appreciated
>>
>> Kind regards,
>> Matthias
>>
--
Matthias Koch
Developer
Averbis GmbH
Salzstraße 15
79098 Freiburg
Germany
Fon: +49 761 708 394 21
Fax: +49 761 708 394 10
Email: matthias.koch@averbis.com
Web: https://averbis.com
Headquarters: Freiburg im Breisgau
Register Court: Amtsgericht Freiburg im Breisgau, HRB 701080
Managing Directors: Dr. med. Philipp Daumke, Dr. Kornél Markó
Re: Feature XMLs
Posted by koch <ma...@averbis.com>.
Ok i think i have it now.
wrap is needed for jars that are no bundle. I forgot the packaging
'bundle' in the dependency, so it was automatically wrapped.
Does this make sense?
On 19.11.20 15:39, koch wrote:
> Hi
>
> i have build a feature.xml that represents my example1 feature: (I
> have used the karaf-maven-plugin to generate this)
> The feature includes just one bundle.
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0"
> name="example1-feature">
> <feature name="example1-feature" description="example1-feature"
> version="1.0.0">
> <details>Example1 Feature</details>
> <bundle>mvn:de......examples/example0-bundle/1.0.0</bundle>
> </feature>
> </features>
>
> now i have build a second example feature that needs the example1
> feature to be installed.
> The feature includes example1 and a bundle.
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0"
> name="example2-feature">
> <repository>mvn:de.......examples/example1-feature/1.0.0/xml/features</repository>
>
> <feature name="example1-feature" description="example1-feature"
> version="1.0.0">
> <details>Example2 Feature</details>
> <feature version="1.0.0" prerequisite="false"
> dependency="false">example1-feature</feature>
> <feature prerequisite="true" dependency="false">wrap</feature>
> <bundle>wrap:mvn:de......plugin.examples/example2-plugin/1.0.0</bundle>
> </feature>
> </features>
>
> When i want to build a kar file i get an error because the 'wrap'
> feature is not installed.
>
> Why is the bundle of the second example wrapper with this wrap feature?
> What does 'wrap:' mean?
> Are my feature.xml files incorrect?
> Why is the first bundle without wrap but the second bundle has this
> wrapped thing?
>
> Any help would be greatly appreciated
>
> Kind regards,
> Matthias
>
--
Matthias Koch
Developer
Averbis GmbH
Salzstraße 15
79098 Freiburg
Germany
Fon: +49 761 708 394 21
Fax: +49 761 708 394 10
Email: matthias.koch@averbis.com
Web: https://averbis.com
Headquarters: Freiburg im Breisgau
Register Court: Amtsgericht Freiburg im Breisgau, HRB 701080
Managing Directors: Dr. med. Philipp Daumke, Dr. Kornél Markó