try for modify on tomcat

This commit is contained in:
joe 2017-09-26 18:45:17 -06:00
parent 490661a73b
commit 0a3934037b
2 changed files with 20 additions and 1 deletions

View file

@ -65,6 +65,7 @@
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- Databases - Uses HSQL by default --> <!-- Databases - Uses HSQL by default -->
<dependency> <dependency>
@ -115,6 +116,11 @@
<artifactId>spring-boot-devtools</artifactId> <artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>

View file

@ -26,10 +26,23 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* *
*/ */
@SpringBootApplication @SpringBootApplication
public class PetClinicApplication { public class PetClinicApplication extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class);
}
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
SpringApplication.run(PetClinicApplication.class, args); SpringApplication.run(PetClinicApplication.class, args);
} }
} }
/**@SpringBootApplication
*public class PetClinicApplication {
*
* public static void main(String[] args) throws Exception {
* SpringApplication.run(PetClinicApplication.class, args);
* }
*
*}
*/