用过spring boot的人都知道,它发布的时候没有项目名,另外,由于它不是一个web项目,这样就会导致发布到其他服务器时,服务器不能识别,把他当成是一个jar包了。为了免去这些麻烦,我们需要把他变成一个web项目,便于日后的开发。具体操作如下: 1.用maven作为项目建设工具 2.搭好springboot 框架 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.4.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent>
UTF-8 UTF-8 1.8 1.1.0.Final com.asofdate batch 0.0.1-SNAPSHOT com.asofdate hauth 0.0.1-SNAPSHOT com.ibeetl beetl 2.7.21 org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-tomcat org.quartz-scheduler quartz 2.2.1 org.quartz-scheduler quartz-jobs 2.2.1 org.springframework.boot spring-boot-starter-data-jpa mysql mysql-connector-java org.springframework.boot spring-boot-starter-thymeleaf org.springframework.boot spring-boot-starter-security io.jsonwebtoken jjwt 0.7.0 org.springframework.batch spring-batch-core 3.0.7.RELEASE org.springframework.boot spring-boot-starter-batch org.springframework spring-context-support org.springframework.boot spring-boot-starter-actuator com.google.code.gson gson junit junit 3.8.1 test io.springfox springfox-swagger2 2.2.2 io.springfox springfox-swagger-ui 2.2.2 org.springframework.data spring-data-redis redis.clients jedis org.mapstruct mapstruct ${org.mapstruct.version} adminMain org.springframework.boot spring-boot-maven-plugin org.apache.maven.plugins maven-resources-plugin true UTF-8
3.把项目变为web项目 4.导入相关包到weblib 5.在主类上添加一句 protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { return builder.sources(AsofdateMain.class ); }