cdijboss-weld

How can I exclude/remove a CDI extension that is added through a 3rd party jar?


As the title says, I want to exclude/remove a CDI extension at runtime that is added through a 3rd party jar? I tried several like ( but with no success) :


Solution

  • You cannot. You can remove it from the classpath, but if it is bundled with a jar that contains other stuff you need, this may not be an option. You can veto certain things it does. If that is not working, then either the extension does not properly respect vetoes, or it is adding (definitionally non-vetoable) synthetic beans (or the like).

    (For completeness, an AlterableContext has nothing to do with portable extensions.)