首先是gradle的配置
group 'zhanSystem'
version '1.0-SNAPSHOT'
apply plugin: 'java'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springVersion")
}
}
apply plugin: 'org.springframework.boot'
dependencies {
compile("org.springframework.boot:spring-boot-starter-thymeleaf")
compile("tk.mybatis:mapper-spring-boot-starter:2.0.3")
compile project(':common-utils')
compile("org.springframework.boot:spring-boot-starter:$springVersion")
compile("org.mybatis.spring.boot:mybatis-spring-boot-starter:$mybatisVersion")
compile("org.springframework.boot:spring-boot-starter-data-redis:$springVersion")
compile("mysql:mysql-connector-java:$mysqlDriverVersion")
compile("org.mybatis.caches:mybatis-ehcache:$mybatisEhcacheVersion")
compile("org.projectlombok:lombok:1.18.0")
compile("javax.persistence:persistence-api:1.0")
compile("org.apache.commons:commons-lang3:3.3")
compile("org.apache.commons:commons-collections4:4.1")
compile ("commons-beanutils:commons-beanutils:1.9.1")
compile ("org.springframework.boot:spring-boot-devtools")
compile group: 'org.apache.poi', name: 'poi', version: '3.12'
compile group: 'org.apache.poi', name: 'poi-ooxml', version: '3.12'
compile group: 'com.alibaba', name: 'fastjson', version: '1.2.47'
/*引入外部JAR包,包文件过大,下载较慢*/
compile group: 'edu.stanford.nlp', name: 'stanford-corenlp', version: '3.9.1'
compile files('lib/stanford-corenlp-3.9.1-javadoc.jar')
compile files('lib/stanford-corenlp-3.9.1-models.jar')
compile files('lib/stanford-corenlp-3.9.1-sources.jar')
compile files('lib/xom.jar')
testCompile("org.springframework.boot:spring-boot-starter-test:$springVersion")
}
application.properties配置
spring.profiles.active=dev
#环境变量
server.max-http-header-size=10240
#服务端口
server.port=8069
#mybatis配置
mybatis.mapperLocations = classpath:mapper/*.xml
mybatis.type-aliases-package = com.zhan.model
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.mode=HTML5
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.content-type=text/html
spring.thymeleaf.cache=false
#日志级别
logging.level.com.zhan.config = info
logging.level.com.zhan.controller = info
logging.level.com.zhan.domain = info
logging.level.com.zhan.mapper = debug
logging.level.com.zhan.service = info
logging.level.com.zhan.utils = info
logging.path=/data/logs/TpoWords
#日志颜色
spring.output.ansi.enabled=always
## 数据源配置
spring.datasource.driver-class-name = com.mysql.jdbc.Driver
spring.datasource.url = jdbc:mysql://0.0.0.0:3306/wordsdb?useUnicode=true&characterEncoding=UTF-8
spring.datasource.username =
spring.datasource.password =
启动类
package com.zhan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import tk.mybatis.spring.annotation.MapperScan;
/**
* 项目启动类
* @author bean.zhang
* @date 2018-07-13
*/
@EnableTransactionManagement
@SpringBootApplication
@MapperScan(basePackages = "com.zhan.mapper")
public class TpoWordApplication {
public static void main(String[] args) {
SpringApplication.run(TpoWordApplication.class, args);
}
}
项目的目录结构