You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Thomas Kellerer <th...@mgm-tp.com> on 2017/06/28 12:35:30 UTC

Maven bundle plugin equivalent for -metatypes

Hello,

I am fighting with getting my portlets to run with Liferay 7 and the whole OSGi environment. 

So far the Felix Maven plugin was a big help because I don't have to manage all the JAR file dependencies in my pom.xml *andÜ the bnd.bnd file that is required by the biz.aQute.bnd plugins.

However, one thing I can't get working with the maven plugin is the equivalent of 

   -metatype: *

in the bnd.bnd file which is required for the configuration stuff to work in Liferay 7. 

I tried 

   <_metatypeannotations>*</_metatypeannotations>

and 

   <_metatypes>*</_metatypes>

in the <instructions> section of the Maven plugin, but that didn't work. When using biz.aQute.bnd plugin the corresponding directive scans the classes for meta annotations and generates a corresponding XML file in OSGI_INF/metatype/ inside the jar file. 

How can I get that to work with the Felix Maven plugin? 

Thanks
Thomas



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


Re: Maven bundle plugin equivalent for -metatypes

Posted by Thomas Kellerer <th...@mgm-tp.com>.
> In my experience, you can use all "-*" instructions in maven-bundle-plugin
> if you replace the colon with an underscore.
> 
> You wrote that you tried <_metatype*s*>*</_metatype*s*>. Why is the "s" in
> the end? Try <_metatype>*</_metatype>.

I feel stupid now :( 

Of course that was it. Sorry for the noise.

Thomas


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


Re: Maven bundle plugin equivalent for -metatypes

Posted by Balázs Zsoldos <ba...@everit.biz>.
Hi Thomas,

In my experience, you can use all "-*" instructions in maven-bundle-plugin
if you replace the colon with an underscore.

You wrote that you tried <_metatype*s*>*</_metatype*s*>. Why is the "s" in
the end? Try <_metatype>*</_metatype>.

Kind regards,
Balazs


On Wed, Jun 28, 2017 at 2:35 PM, Thomas Kellerer <thomas.kellerer@mgm-tp.com
> wrote:

> Hello,
>
> I am fighting with getting my portlets to run with Liferay 7 and the whole
> OSGi environment.
>
> So far the Felix Maven plugin was a big help because I don't have to
> manage all the JAR file dependencies in my pom.xml *andÜ the bnd.bnd file
> that is required by the biz.aQute.bnd plugins.
>
> However, one thing I can't get working with the maven plugin is the
> equivalent of
>
>    -metatype: *
>
> in the bnd.bnd file which is required for the configuration stuff to work
> in Liferay 7.
>
> I tried
>
>    <_metatypeannotations>*</_metatypeannotations>
>
> and
>
>    <_metatypes>*</_metatypes>
>
> in the <instructions> section of the Maven plugin, but that didn't work.
> When using biz.aQute.bnd plugin the corresponding directive scans the
> classes for meta annotations and generates a corresponding XML file in
> OSGI_INF/metatype/ inside the jar file.
>
> How can I get that to work with the Felix Maven plugin?
>
> Thanks
> Thomas
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Maven bundle plugin equivalent for -metatypes

Posted by Neil Bartlett <nj...@gmail.com>.
> On 28 Jun 2017, at 13:55, Thomas Kellerer <th...@mgm-tp.com> wrote:
> 
>> Actually any JARs that you place under src/main/resources will be included in the bundle — just as in any other Maven project.
> 
> But the jars are not stored in src/main/resources 
> 
> They simply declared as dependencies in the Maven pom.

I see, fair enough. Then you do need a bnd.bnd file with -includeresource when you really need to embed a dependent library… though I still assert that this is rarely necessary.

> 
> 
>> But I’m wondering why you need to do this? Embedding JAR files should
>> be a rarely used technique, for example when wrapping an external
>> non-OSGi dependency for use in OSGi. If lots of your bundles need to
>> embed JARs then something very strange is going on.
> 
> I need this because my portlets need those jar files. 
> 
> I have no idea how else I could use those libraries in my portlets if I do not include them in the bundle. 

Import-Package.

> 
> If I don't include them in the bundle, Liferay (Felix?) won't even load the portlet. 
> 
> Thomas
> 
> 
> ---------------------------------------------------------------------
> 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 equivalent for -metatypes

Posted by Thomas Kellerer <th...@mgm-tp.com>.
> Actually any JARs that you place under src/main/resources will be included in the bundle — just as in any other Maven project.

But the jars are not stored in src/main/resources 

They simply declared as dependencies in the Maven pom. 

> But I’m wondering why you need to do this? Embedding JAR files should
> be a rarely used technique, for example when wrapping an external
> non-OSGi dependency for use in OSGi. If lots of your bundles need to
> embed JARs then something very strange is going on.

I need this because my portlets need those jar files. 

I have no idea how else I could use those libraries in my portlets if I do not include them in the bundle. 

If I don't include them in the bundle, Liferay (Felix?) won't even load the portlet. 

Thomas


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


Re: Maven bundle plugin equivalent for -metatypes

Posted by Neil Bartlett <nj...@gmail.com>.
Actually any JARs that you place under src/main/resources will be included in the bundle — just as in any other Maven project.

But I’m wondering why you need to do this? Embedding JAR files should be a rarely used technique, for example when wrapping an external non-OSGi dependency for use in OSGi. If lots of your bundles need to embed JARs then something very strange is going on.

Regards,
Neil


> On 28 Jun 2017, at 13:46, Thomas Kellerer <th...@mgm-tp.com> wrote:
> 
> Thanks for the quick reply, however I could not include any needed jar files in the bundle without using "-includeresource:" in the bnd file for all dependent jar files. 
> 
> Thomas
> 
> Neil Bartlett schrieb am 28.06.2017 um 14:40:
>> Just a quick note: the bnd.bnd file is NOT required by the biz.aQute.bnd plugins. It is only used when you need to do something special in a bundle definition like a custom annotation header.
>> 
>> Sorry I can’t answer your question about metatype with the maven-bundle-plugin.
>> 
>> Regards,
>> Neil
>> 
>> 
>>> On 28 Jun 2017, at 13:35, Thomas Kellerer <th...@mgm-tp.com> wrote:
>>> 
>>> Hello,
>>> 
>>> I am fighting with getting my portlets to run with Liferay 7 and the whole OSGi environment. 
>>> 
>>> So far the Felix Maven plugin was a big help because I don't have to manage all the JAR file dependencies in my pom.xml *andÜ the bnd.bnd file that is required by the biz.aQute.bnd plugins.
>>> 
>>> However, one thing I can't get working with the maven plugin is the equivalent of 
>>> 
>>>  -metatype: *
>>> 
>>> in the bnd.bnd file which is required for the configuration stuff to work in Liferay 7. 
>>> 
>>> I tried 
>>> 
>>>  <_metatypeannotations>*</_metatypeannotations>
>>> 
>>> and 
>>> 
>>>  <_metatypes>*</_metatypes>
>>> 
>>> in the <instructions> section of the Maven plugin, but that didn't work. When using biz.aQute.bnd plugin the corresponding directive scans the classes for meta annotations and generates a corresponding XML file in OSGI_INF/metatype/ inside the jar file. 
>>> 
>>> How can I get that to work with the Felix Maven plugin? 
>>> 
>>> Thanks
>>> Thomas
>>> 
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> 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
> 


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


Re: Maven bundle plugin equivalent for -metatypes

Posted by Thomas Kellerer <th...@mgm-tp.com>.
Thanks for the quick reply, however I could not include any needed jar files in the bundle without using "-includeresource:" in the bnd file for all dependent jar files. 

Thomas

Neil Bartlett schrieb am 28.06.2017 um 14:40:
> Just a quick note: the bnd.bnd file is NOT required by the biz.aQute.bnd plugins. It is only used when you need to do something special in a bundle definition like a custom annotation header.
> 
> Sorry I can’t answer your question about metatype with the maven-bundle-plugin.
> 
> Regards,
> Neil
> 
> 
>> On 28 Jun 2017, at 13:35, Thomas Kellerer <th...@mgm-tp.com> wrote:
>>
>> Hello,
>>
>> I am fighting with getting my portlets to run with Liferay 7 and the whole OSGi environment. 
>>
>> So far the Felix Maven plugin was a big help because I don't have to manage all the JAR file dependencies in my pom.xml *andÜ the bnd.bnd file that is required by the biz.aQute.bnd plugins.
>>
>> However, one thing I can't get working with the maven plugin is the equivalent of 
>>
>>   -metatype: *
>>
>> in the bnd.bnd file which is required for the configuration stuff to work in Liferay 7. 
>>
>> I tried 
>>
>>   <_metatypeannotations>*</_metatypeannotations>
>>
>> and 
>>
>>   <_metatypes>*</_metatypes>
>>
>> in the <instructions> section of the Maven plugin, but that didn't work. When using biz.aQute.bnd plugin the corresponding directive scans the classes for meta annotations and generates a corresponding XML file in OSGI_INF/metatype/ inside the jar file. 
>>
>> How can I get that to work with the Felix Maven plugin? 
>>
>> Thanks
>> Thomas
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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 equivalent for -metatypes

Posted by Neil Bartlett <nj...@gmail.com>.
Just a quick note: the bnd.bnd file is NOT required by the biz.aQute.bnd plugins. It is only used when you need to do something special in a bundle definition like a custom annotation header.

Sorry I can’t answer your question about metatype with the maven-bundle-plugin.

Regards,
Neil


> On 28 Jun 2017, at 13:35, Thomas Kellerer <th...@mgm-tp.com> wrote:
> 
> Hello,
> 
> I am fighting with getting my portlets to run with Liferay 7 and the whole OSGi environment. 
> 
> So far the Felix Maven plugin was a big help because I don't have to manage all the JAR file dependencies in my pom.xml *andÜ the bnd.bnd file that is required by the biz.aQute.bnd plugins.
> 
> However, one thing I can't get working with the maven plugin is the equivalent of 
> 
>   -metatype: *
> 
> in the bnd.bnd file which is required for the configuration stuff to work in Liferay 7. 
> 
> I tried 
> 
>   <_metatypeannotations>*</_metatypeannotations>
> 
> and 
> 
>   <_metatypes>*</_metatypes>
> 
> in the <instructions> section of the Maven plugin, but that didn't work. When using biz.aQute.bnd plugin the corresponding directive scans the classes for meta annotations and generates a corresponding XML file in OSGI_INF/metatype/ inside the jar file. 
> 
> How can I get that to work with the Felix Maven plugin? 
> 
> Thanks
> Thomas
> 
> 
> 
> ---------------------------------------------------------------------
> 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