title: Implementing plugin architecture in annotation based Spring Boot Application
body: <p>I want to implement plugin architecture in Spring Boot application. Let me explain my scenario. I have a main application, which starts the server, manages security, etc. The app is like the root of my final product which will include this root app and other plugins added to it. </p>
  
  <p>Now, the plugins are Spring Boot application themselves, which I may add to the root app by dynamically searching for jars in the specific path or by added them to project dependency as library. </p>
  
  <p>Plugins have their own configurations and are like apps running inside the main root app. Let's say if the root app runs the server, the plugin app may have all the controllers (endpoints), beans etc that provide functionality to my product.</p>
  
  <p>This is the premise, now what I want to know is,</p>
  
  <ol>
  <li>How can I achieve this architecture?</li>
  <li>How will the root app communicate with the plugins?</li>
  <li>Will they have separate application contexts?</li>
  <li>How can I boot and configure child app from the root app?</li>
  <li>When the application receives the request from clients how can I route the request to specific controller inside specific plugin considering I may have many plugins.</li>
  </ol>
  
  <p>I am confused about the concept here, and how it can work. Any sort of help is appreciated. If there is some example that anyone can provide, that will be just wonderful.</p>