springboot部署到tomcat容器

1. maven依賴加上

<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-tomcat</artifactId>
   <scope>provided</scope>
</dependency>

 

2. 註釋掉pom.xml裏面的bootclasspath,沒有的忽略。 

3. jdk環境設置好,我這裏用的是jdk1.8, 之前用的1.6出錯。 

 

4. java啓動類加上

@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
    return application.sources(ArchApplication.class);
}

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章