build.gradle
buildscript {
ext {
springBootVersion = '2.0.4.RELEASE'
jjwtVersion = '0.9.0'
findbugsVersion='3.0.1'
bootstrapVersion = '3.3.7'
jqueryVersion = '3.3.1'
vueVersion ='2.5.13'
fontawesomeVersion = '5.2.0'
jspapiVersion = '2.3.3'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
/*
* 在這個段落中你可以聲明使用哪些外掛程式
* apply plugin: 'java' 代表這是一個Java專案,需要使用java外掛程式
* 如果想生成一個 `Intellij IDEA` 的工程,類似的如果要生成
* eclipse工程,就寫 apply plugin: 'eclipse'
* 同樣的我們要學的是Spring Boot,所以應用Spring Boot外掛程式
*/
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
// 在這個段落中你可以聲明編譯後的Jar檔資訊
bootJar {
baseName = 'myspring'
group = 'com.polinwei'
version = '0.0.1-SNAPSHOT'
}
// 在這個段落中你可以聲明原始檔案和目標編譯後的Java版本相容性
sourceCompatibility = 1.8
targetCompatibility = 1.8
// 在這個段落中你可以聲明在哪裡可以找到你的項目依賴
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
maven { url "https://code.lds.org/nexus/content/groups/main-repo"}
maven { url "http://maven.aliyun.com/nexus/content/repositories/central"}
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-data-jpa")
compile("org.springframework.boot:spring-boot-starter-thymeleaf")
compile("org.springframework.boot:spring-boot-starter-freemarker")
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.boot:spring-boot-starter-security")
compile("org.springframework.security:spring-security-taglibs")
compile("org.springframework.boot:spring-boot-devtools") // Class 程式有更改時, 自動重啟
compile("org.hibernate.validator:hibernate-validator") //驗證
compile("javax.servlet.jsp:javax.servlet.jsp-api:${jspapiVersion}")
compile("org.springframework.session:spring-session-data-redis")
compile("org.springframework.boot:spring-boot-starter-data-redis")
runtime("mysql:mysql-connector-java")
compileOnly("org.projectlombok:lombok")
compile("com.maxmind.geoip2:geoip2:2.12.0")
compile("io.jsonwebtoken:jjwt:${jjwtVersion}")
compile("com.google.code.findbugs:findbugs:${findbugsVersion}")
compile("org.webjars:bootstrap:${bootstrapVersion}")
compile("org.webjars:jquery:${jqueryVersion}")
compile("org.webjars:vue:${vueVersion}")
compile("org.webjars:font-awesome:${fontawesomeVersion}")
compile("org.webjars.bowergithub.lipis:flag-icon-css:3.1.0")
compileOnly("org.springframework.boot:spring-boot-configuration-processor")
testCompile("org.springframework.boot:spring-boot-starter-test")
testCompile("org.springframework.security:spring-security-test")
}