Configuring base package scan for Spring Boot Application at Runtime
<p>I'm running a Spring Boot Application within a Tomcat instance packaged as a war file. I would like to be able to add "packages" to my instance in the form of rest services. To that end I need to be able to configure scanBasePackages in the @SpringBootApplication annotation at runtime. i.e. when tomcat starts up. For now I have ...</p>

<pre><code>@SpringBootApplication(scanBasePackages="path1, path2")
public class RestApplication extends SpringBootServletInitializer {
   //code
}
</code></pre>

<p>...but I would like to have path2 be configurable and alternately be able to add path3, etc. if desired. How can I achieve this? I understand that I can't configure the String in the annotation so my question is about what other alternatives I have to this annotation for setting this.</p>

<p>Cheers.</p>