So…
It works and here are a few things to know as per my latest understanding of things:
Segregate and isolate all imports from the module being aware of into one bean implementation class.
That bean is entirely defined for Spring through its @OpenmrsProfile annotation.
There should be (1) no entry in the application context XML file and (2) no @Component annotation. Those would trigger Spring to wire that bean ahead of the OpenMRS-specific conditions leading to runtime trouble.
All this implies that the bean won’t have a known bean ID, meaning that…
This bean can only be @Autowired, and even presumably @Autowired(required = false) depending on the conditions.
All the above can lead to a slight headache on the context-sensitive tests side of things. Hence those two new topics on which I would be eager to get input:
@mogoodrich basically this all means that the PR for ADDR-108 is being delayed…