Jdruwe
Jdruwe

Reputation: 3520

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

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?

Upvotes: 1

Views: 979

Answers (1)

Jdruwe
Jdruwe

Reputation: 3520

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.

Upvotes: 2

Related Questions