Java Spring boot scan components from external jar

30 Views Asked by At

Short proiblem descriotrion

  1. i have 2 jar files main-module.jar and sub-module.jar
  2. main-module.jar is a spring-boot application
  3. sub-module.jar has few components which i want to have in my running main-module application
  4. both main-module and sub-module have simillar package structure eg. com.something.mainapp, com.something.subapp
  5. @ComponentScan in set to com.something
  6. i want to be able to include many JAR files only using the JAVA jut command and scan the via ConponentScan to the spring context

files which i have

enter image description here

used commands

 java -cp sub-module.jar:* -jar .\main-module.jar
0

There are 0 best solutions below