Last active
August 29, 2015 14:20
-
-
Save jonashackt/bab4fdb18434460277df to your computer and use it in GitHub Desktop.
Deploying Spring Boot as fat war
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The inheritance of SpringBootServletInitializer is necessary for the war-Deployment-ability | |
@ComponentScan("de.codecentric.somepackage") | |
@EnableAutoConfiguration | |
@Configuration | |
public class Application extends SpringBootServletInitializer { | |
private static Class<Application> applicationClass = Application.class; | |
@Override | |
protected SpringApplicationBuilder configure(SpringApplicationBuilder applicationBuilder) { | |
return applicationBuilder.sources(applicationClass); | |
} | |
public static void main(String[] args) { | |
SpringApplication.run(Application.class, args); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment