Welcome to CodeRanch, Matthias!
It depends quite a bit on how you are creating the application context or web application context.
To turn off
all annotation processing by Spring:
- Don't create any AnnotationConfigApplicationContext instances, if you are doing so
- Remove any
<context:component-scan> tags in context XMLs
- Remove any
<context:annotation-driven> tags in context XMLs
- As Tushar has mentioned, remove any <mvc:annotation-driven> tags in context XMLs
To turn on or off annotation processing selectively:
- Don't annotate the new beans
- Or create AnnotationConfigApplicationContext instance with list of packages or classes to be processed by Spring. Everything else is excluded, even if it has annotations.
- Or specify <context:component-scan> with attributes base-package, include-filters and exclude-filters to control which packages and classes get annotated.
While what you want is possible, I'm wondering what happens if someday you have to make an old bean talk to a new bean or vice versa.
I feel in the long run you are introducing more technical debt by using two different DI frameworks. Sometime down the line, subsequent maintainers will wonder why there are two DI frameworks.
It's probably better to continue with the existing framework, or refactor the entire project (one class at a time, and please don't forget to write tests before starting!) to use only Spring.