Refactor application configuration load.

master
Rémi Cocula 8 years ago
parent 2bbe8444f2
commit 3fe8b7c0df
  1. 11
      libresonic-main/src/main/java/org/libresonic/player/boot/Application.java

@ -145,16 +145,21 @@ public class Application extends SpringBootServletInitializer {
return new ResponseHeaderFilter();
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
private static SpringApplicationBuilder doConfigure(SpringApplicationBuilder application) {
// Customize the application or call application.sources(...) to add sources
// Since our example is itself a @Configuration class (via @SpringBootApplication)
// we actually don't need to override this method.
return application.sources(Application.class).web(true).initializers(new AdditionalPropertySourceConfigurer());
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return doConfigure(application);
}
public static void main(String[] args) {
new SpringApplicationBuilder(Application.class).run(args);
SpringApplicationBuilder builder = new SpringApplicationBuilder();
doConfigure(builder).run(args);
}
}
Loading…
Cancel
Save