I have annotated my classes with @Repository, @Resource, @Component, @Service annotations but these classes must run in 2 environments. The first environment is Spring 2.x based while the other has no spring at all. I'm sure the code will fail without the spring jars & I want to know ideas from you on how I can retain the annotations but still work in both environments
To be able to use the annotations that you mention, or really, let Spring use them for you so you get the benefit, you need to use at least Spring 2.5.x, that's when they were introduced.
Furthermore, annotations are not required to be on the classpath. They will just be ignored. Since when you are using spring 2.0 there will be no code that tries to 'scan' for them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With