If you use some XWiki Maven Build Tools such as the Extension Plugin or the Packager Plugin, we introduced a new parameter disabledComponents in those mojos to allow to unregister some components during their execution.
A typical usage of such parameter can be to prevent the execution of a MandatoryDocumentInitializer, for example:
<configuration>
<disabledComponents>
<disabledComponent>
<type>com.xpn.xwiki.doc.MandatoryDocumentInitializer</type>
<role>XWiki.XWikiServerXwiki</role>
</disabledComponent>
</disabledComponents>
</configuration>
<disabledComponents>
<disabledComponent>
<type>com.xpn.xwiki.doc.MandatoryDocumentInitializer</type>
<role>XWiki.XWikiServerXwiki</role>
</disabledComponent>
</disabledComponents>
</configuration>