There are 4 projects.
- project1
- project2
- project3
- project4
Project2 has 2 projects in build path. i.e. project1 and project3
Project1 has a class that reads property from a properties file. Project2
can access that class to getProperty.
project4 has only one project3 in its build path.
It means project3 is in build path of two projects.
I want to get property in project4. I have no choice to include project1 in project4.
Whatelse can I do to get property?
Can I do one think like: While starting project2. Load a list with properties in project3. Then access that from project4?
As project 2 can have access to classes in project 1, so an interface will be created in project 3. A class in project 2 will implement this interface having function to read property from properties file. Project 4 is in shared library of project 2. Spring does a trick. A method in project 4 gets bean through applicationcontext, of that class which was created in project 2. After getting this bean, property can be accessed.