How to retrieve sub modules properties for core?

Viewed 26

I am new to Spring MVC, and would appreciate some help.

project
  - pom.xml     
  - Batch A
      -- src\main\java
         + .....
      -- src\main\resources
         + property-dev.properties
         + property-uat.properties
      -- pom.xml
- Batch B
      -- src\main\java
         + .....
      -- src\main\resources
         + property-dev.properties
         + property-uat.properties
      -- pom.xml
  - Shared Module 
      -- src\main\java
         + App.class            //shared App.class to call either batchA or batchB
         + PropertyConfigurer.java  //retrieves data from properties file
      --- pom.xml

App.class is meant to run Batch A and Batch B, based on the arguments on runtime. PropertyConfigurer, it loads data from property-x.properties

I pass parameters like batchA/batchB... on argument for batchA, it will execute what I have for batchA.

However, on passing arguments for batchA, I am unable to load property-dev.properties from batchA... is there any way that I can achieve that? PropertyConfigurer here looks for parameters in SharedModule, while I need to load from either batchA/ batchB.

Thank you.

1 Answers

Somehow, when I changed the version for my Spring dependencies in the modules to be of the same version, it worked. I think the issue could be due to dependencies conflict, hence, I was unable to load properties/classes from other modules except for shared/core.

Related