-
Jan 15th, 2012, 04:06 PM
#1
Injecting dependencies possibly by scanning but not knowing the package
Hi,
I need to inject dependencies in class A with instances of interface B.
like so:
public class A{
@Autowired private B dependency;
// Remainder of of A definition
}
Class A is in Maven module M1. I will create instances on B in Maven module M2. M2 depends on M1 although the spring xml configuration must be in M1. I do not know to what packages the implementation of B will belong to in advance so I cannot set the component scan base package. Is there any alternative way so that the application container defined using the configuration in M1 can scan and/or create beans form the implementations in M2?
Thanks in advance,
Luigi
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules