You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Ge@@ru" <ge...@gmail.com> on 2011/11/25 15:35:34 UTC
Issue on maven-bundle-plugin on export osgi service with property
on blueprint
Hi,
i don't know if this is an issue or is correct.
When it is create an osgi bundle with blueprint and service use property
like this example:
<blueprint
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.2.0"
default-availability="optional">
<!--
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
-->
<service ref="helloservice"
interface="it.test.helloword.HelloWord" >
<service-properties>
<entry key="version">
<value type="java.lang.String">2</value>
</entry>
</service-properties>
</service>
<bean id="helloservice" class="it.test.HelloWordImpl"
init-method="startUp">
</bean>
</blueprint>
On manifest property value isn't visible:
Export-Service: it.test.helloword.HelloWord;version=""
Is correct that value isn' present ?
However, service and use of the properties are correct, all works fine.
Thanks in advance.
Geaaru
Re: Issue on maven-bundle-plugin on export osgi service with property on blueprint
Posted by Stuart McCulloch <mc...@gmail.com>.
On 25 Nov 2011, at 14:35, Ge@@ru wrote:
> Hi,
>
> i don't know if this is an issue or is correct.
>
> When it is create an osgi bundle with blueprint and service use property
> like this example:
>
> <blueprint
> xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>
> xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.2.0"
> default-availability="optional">
> <!--
> xsi:schemaLocation="
> http://www.osgi.org/xmlns/blueprint/v1.0.0
> http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
> -->
>
> <service ref="helloservice"
> interface="it.test.helloword.HelloWord" >
> <service-properties>
> <entry key="version">
> <value type="java.lang.String">2</value>
> </entry>
> </service-properties>
> </service>
>
> <bean id="helloservice" class="it.test.HelloWordImpl"
> init-method="startUp">
> </bean>
> </blueprint>
>
> On manifest property value isn't visible:
>
> Export-Service: it.test.helloword.HelloWord;version=""
>
> Is correct that value isn' present ?
Looking at the Blueprint XSLT:
http://svn.apache.org/repos/asf/felix/trunk/bundleplugin/src/main/resources/org/apache/felix/bundleplugin/blueprint.xsl
it only captures service properties that have values as attributes and not embedded <value> tags:
<xsl:value-of select="concat(';', @key, '="', @value, '"')" />
If someone wants to provide a patch that adds support for embedded <value> tags that would be cool :)
Otherwise the workaround would be to use the short form:
<entry key="version" value="2" />
HTH
> However, service and use of the properties are correct, all works fine.
>
> Thanks in advance.
>
> Geaaru
>
>