Spring Boot 1.3.x ã® Web ã¢ããªã 1.4.x ã¸ãã¼ã¸ã§ã³ã¢ãããã ( ãã®ï¼ï¼ )( Spring Boot ã 1.4.4 â 1.4.5 ã«ãã¼ã¸ã§ã³ã¢ãããã )
æ¦è¦
è¨äºä¸è¦§ã¯ãã¡ãã§ãã
- ä»åã®æé ã§ç¢ºèªã§ããã®ã¯ä»¥ä¸ã®å
容ã§ãã
- è¨äºãæ¸ãå§ããæã® Spring Boot ã®ãã¼ã¸ã§ã³ã¯ 1.4.4 ã§ãããã1.4.5 ãåºã¦ããã®ã§ãã¼ã¸ã§ã³ã¢ãããã¾ãã
- Error Prone 以å¤ã®ã©ã¤ãã©ãªãææ°ãã¼ã¸ã§ã³ã«ãã¼ã¸ã§ã³ã¢ãããã¾ãã
- build.gradle ã®æ¸ãæ¹ã§ãæè¿ã¯
jar { ... }
ã¯æ¸ããã« group, version ãä¸çªä¸ã«æ¸ãããã«ãã¦ããã®ã§ããã®ããã«å¤æ´ãã¾ããã¾ã Error Prone ã®compileJava.options.compilerArgs += ['-Xep:RemoveUnusedImports:WARN']
ã®è¨å®ã追å ãã¦ä¸è¦ãª import æãæ¤åºãããããã«ãã¾ãã
åç §ãããµã¤ãã»æ¸ç±
ç®æ¬¡
- build.gradle ãå¤æ´ãã
- clean ã¿ã¹ã¯ â Rebuild Project â build ã¿ã¹ã¯ãå®è¡ãã
- ã¡ã¢æ¸ã
æé
build.gradle ãå¤æ´ãã
-
build.gradle ã ãªã³ã¯å ã®å 容 ã«å¤æ´ãã¾ãã
å¤æ´å¾ãGradle Tool Window ã®å·¦ä¸ã«ãããRefresh all Gradle projectsããã¿ã³ãã¯ãªãã¯ãã¦æ´æ°ãã¾ãã
clean ã¿ã¹ã¯ â Rebuild Project â build ã¿ã¹ã¯ãå®è¡ãã
clean ã¿ã¹ã¯ â Rebuild Project â build ã¿ã¹ã¯ãå®è¡ãã¾ãã
build.gradle ã«è¿½å ãã
compileJava.options.compilerArgs += ['-Xep:RemoveUnusedImports:WARN']
ã«ããã使ç¨ããã¦ããªã import æãå ¥ã£ã¦ããã½ã¼ã¹ããã°ã«åºåããã¦ãã¾ããã以ä¸ã®ï¼ãã¡ã¤ã«ã§ããä¸è¦ãª import æãåé¤ãã¾ãã- src/main/java/ksbysample/webapp/lending/Application.java
- src/main/java/ksbysample/webapp/lending/helper/url/UrlAfterLoginHelper.java
ä»ã¯åé¡ãªãããã§ç¡äº “BUILD SUCCESSFUL” ã®ã¡ãã»ã¼ã¸ã表示ããã¦ãã¾ãã
Project Tool Window ã® src/test ãããRun âAll Testsâ with Coverageããå®è¡ããã¨ããã¡ããå ¨ã¦ã®ãã¹ããæåãã¾ããã
ã¡ã¢æ¸ã
- Lombok ã® 1.16.16 ãåºã¦ããã®ã§ Lombok Changelog ãè¦ã¦ã¿ãã®ã§ããã
JDK9 now supported
ã¨è¨è¿°ããã¦ãã¾ãããããã§ãããã Error Prone ã®ãã¼ã¸ã§ã³ã¢ãããåºæ¥ãããï¼ï¼
ã½ã¼ã¹ã³ã¼ã
build.gradle
group 'ksbysample' version '1.4.5-RELEASE' buildscript { ext { springBootVersion = '1.4.5.RELEASE' } repositories { jcenter() maven { url "http://repo.spring.io/repo/" } maven { url "https://plugins.gradle.org/m2/" } } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") // for Error Prone ( http://errorprone.info/ ) classpath("net.ltgt.gradle:gradle-errorprone-plugin:0.0.9") // for Grgit classpath("org.ajoberstar:grgit:1.9.0") // Gradle Download Task classpath("de.undercouch:gradle-download-task:3.2.0") } } apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'idea' apply plugin: 'org.springframework.boot' apply plugin: 'de.undercouch.download' apply plugin: 'groovy' apply plugin: 'net.ltgt.errorprone' apply plugin: 'checkstyle' apply plugin: 'findbugs' sourceCompatibility = 1.8 targetCompatibility = 1.8 task wrapper(type: Wrapper) { gradleVersion = '2.13' } [compileJava, compileTestGroovy, compileTestJava]*.options*.compilerArgs = ['-Xlint:all,-options,-processing,-path'] compileJava.options.compilerArgs += ['-Xep:RemoveUnusedImports:WARN'] // for Doma 2 // Javaã¯ã©ã¹ã¨SQLãã¡ã¤ã«ã®åºåå ãã£ã¬ã¯ããªãåãã«ãã processResources.destinationDir = compileJava.destinationDir // ã³ã³ãã¤ã«ããåã«SQLãã¡ã¤ã«ãåºåå ãã£ã¬ã¯ããªã«ã³ãã¼ããããã«ä¾åé¢ä¿ãé転ãã compileJava.dependsOn processResources idea { module { inheritOutputDirs = false outputDir = file("$buildDir/classes/main/") } } configurations { // for Doma 2 domaGenRuntime } checkstyle { configFile = file("${rootProject.projectDir}/config/checkstyle/google_checks.xml") toolVersion = '7.6.1' sourceSets = [project.sourceSets.main] } findbugs { toolVersion = '3.0.1' sourceSets = [project.sourceSets.main] ignoreFailures = true effort = "max" excludeFilter = file("${rootProject.projectDir}/config/findbugs/findbugs-exclude.xml") } tasks.withType(FindBugs) { reports { xml.enabled = false html.enabled = true } } repositories { jcenter() } dependencyManagement { imports { mavenBom("io.spring.platform:platform-bom:Athens-SR4") { bomProperty 'commons-lang3.version', '3.5' bomProperty 'guava.version', '21.0' } } } bootRepackage { mainClass = 'ksbysample.webapp.lending.Application' excludeDevtools = true } dependencies { def jdbcDriver = "org.postgresql:postgresql:9.4.1212" def spockVersion = "1.1-groovy-2.4-rc-4" def domaVersion = "2.16.0" def lombokVersion = "1.16.16" def errorproneVersion = "2.0.15" // dependency-management-plugin ã«ãããã¼ã¸ã§ã³çªå·ãèªåã§è¨å®ããããã® // Appendix A. Dependency versions ( http://docs.spring.io/platform/docs/current/reference/htmlsingle/#appendix-dependency-versions ) åç § compile("org.springframework.boot:spring-boot-starter-web") compile("org.springframework.boot:spring-boot-starter-thymeleaf") compile("org.thymeleaf.extras:thymeleaf-extras-springsecurity4") compile("org.thymeleaf.extras:thymeleaf-extras-java8time") compile("org.springframework.boot:spring-boot-starter-data-jpa") compile("org.springframework.boot:spring-boot-starter-freemarker") compile("org.springframework.boot:spring-boot-starter-mail") compile("org.springframework.boot:spring-boot-starter-security") compile("org.springframework.boot:spring-boot-starter-data-redis") compile("org.springframework.boot:spring-boot-starter-amqp") compile("org.springframework.boot:spring-boot-devtools") compile("org.springframework.session:spring-session") compile("org.springframework.retry:spring-retry") compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") compile("com.google.guava:guava") compile("org.apache.commons:commons-lang3") compile("org.codehaus.janino:janino") testCompile("org.springframework.boot:spring-boot-starter-test") testCompile("org.springframework.security:spring-security-test") testCompile("org.yaml:snakeyaml") testCompile("org.mockito:mockito-core") // dependency-management-plugin ã«ãããã¼ã¸ã§ã³çªå·ãèªåã§è¨å®ãããªããã®ããããã¯ææ°ãã¼ã¸ã§ã³ãæå®ããããã® runtime("${jdbcDriver}") compile("org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4.1:1.16") compile("org.simpleframework:simple-xml:2.7.1") compile("com.univocity:univocity-parsers:2.3.1") testCompile("org.dbunit:dbunit:2.5.3") testCompile("com.icegreen:greenmail:1.5.3") testCompile("org.assertj:assertj-core:3.6.2") testCompile("com.jayway.jsonpath:json-path:2.2.0") testCompile("org.spockframework:spock-core:${spockVersion}") { exclude module: "groovy-all" } testCompile("org.spockframework:spock-spring:${spockVersion}") { exclude module: "groovy-all" } testCompile("com.google.code.findbugs:jsr305:3.0.2") // for lombok compileOnly("org.projectlombok:lombok:${lombokVersion}") testCompileOnly("org.projectlombok:lombok:${lombokVersion}") // for Doma compile("org.seasar.doma:doma:${domaVersion}") domaGenRuntime("org.seasar.doma:doma-gen:${domaVersion}") domaGenRuntime("${jdbcDriver}") // for Error Prone ( http://errorprone.info/ ) errorprone("com.google.errorprone:error_prone_core:${errorproneVersion}") compileOnly("com.google.errorprone:error_prone_annotations:${errorproneVersion}") } ..........
group 'ksbysample'
ã追å ãã¾ããversion '1.4.5-RELEASE'
ã追å ãã¾ãããã¼ã¸ã§ã³çªå·ã¯ Spring Boot ã®ãã¼ã¸ã§ã³ã«åããã¾ãã- buildscript ã®ä»¥ä¸ã®ç¹ãå¤æ´ãã¾ãã
springBootVersion = '1.4.4.RELEASE'
âspringBootVersion = '1.4.5.RELEASE'
ã«å¤æ´ãã¾ããclasspath("org.ajoberstar:grgit:1.8.0")
âclasspath("org.ajoberstar:grgit:1.9.0")
ã«å¤æ´ãã¾ãã
compileJava.options.compilerArgs += ['-Xep:RemoveUnusedImports:WARN']
ã追å ãã¾ããjar { ... }
ãåé¤ãã¾ãã- checkstyle ã®ä»¥ä¸ã®ç¹ãå¤æ´ãã¾ãã
toolVersion = '7.5.1'
âtoolVersion = '7.6.1'
ã«å¤æ´ãã¾ãã
- dependencyManagement ã®ä»¥ä¸ã®ç¹ãå¤æ´ãã¾ãã
mavenBom("io.spring.platform:platform-bom:Athens-SR3")
âmavenBom("io.spring.platform:platform-bom:Athens-SR4")
ã«å¤æ´ãã¾ãã
- dependencies ã®ä»¥ä¸ã®ç¹ãå¤æ´ãã¾ãã
def jdbcDriver = "org.postgresql:postgresql:9.4.1212"
âdef jdbcDriver = "org.postgresql:postgresql:42.0.0"
ã«å¤æ´ãã¾ããdef spockVersion = "1.1-groovy-2.4-rc-3"
âdef spockVersion = "1.1-groovy-2.4-rc-4"
ã«å¤æ´ãã¾ããdef domaVersion = "2.15.0"
âdef domaVersion = "2.16.0"
ã«å¤æ´ãã¾ããdef lombokVersion = "1.16.12"
âdef lombokVersion = "1.16.16"
ã«å¤æ´ãã¾ããcompile("com.univocity:univocity-parsers:2.3.1")
âcompile("com.univocity:univocity-parsers:2.4.1")
ã«å¤æ´ãã¾ããtestCompile("com.google.code.findbugs:jsr305:3.0.1")
âtestCompile("com.google.code.findbugs:jsr305:3.0.2")
ã«å¤æ´ãã¾ãã// for Doma Gen
â// for Doma
ã¸ã³ã¡ã³ããå¤æ´ããcompile("org.seasar.doma:doma:${domaVersion}")
ããã®ã³ã¡ã³ãã®ä¸ã«ç§»åãã¾ããDoma ã®è¨è¿°ã¯ï¼ã¤ã«ã¾ã¨ãããã¨ã«ãã¾ãã
å±¥æ´
2017/04/08
åççºè¡ã