AEM 6.3, maven-bundle-plugin automate OSGi SCR metadata for OSGi annotated classes

二次信任 提交于 2019-12-11 06:06:48

问题


I am trying to unit test my OSGI R6 annotated classes. I found out that I have to specify some info in the maven-bundle-plugin: http://felix.apache.org/documentation/faqs/apache-felix-bundle-plugin-faq.html#use-scr-metadata-generated-by-bnd-in-unit-tests --> Use SCR metadata generated by BND in Unit Tests.

If I invalidate cache in Intellij and restart and try to execute my test again it fails. If I manually trigger the manifest goal of the maven-bundle-plugin and run the test it succeeds, can I automate the generation of the metadata?

Will this configuration still work for tests that are written for classes using the older felix src annotations?


回答1:


I forgot <exportScr>true</exportScr> in the maven config. Now I only have to run my test later in the lifecyle as explained here: https://github.com/Adobe-Marketing-Cloud/aem-project-archetype/blob/8aecf81ea5bb897a7d8dd5f241d5fcd561c36aa6/src/main/archetype/it.launcher/pom.xml and all will be good.



来源:https://stackoverflow.com/questions/48671484/aem-6-3-maven-bundle-plugin-automate-osgi-scr-metadata-for-osgi-annotated-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!