Spring Boot + npm + Geb ã§å ¥åãã©ã¼ã ãä½ã£ã¦ãã¹ããã ( ãã®ï¼ï¼ )( build.gradle ã«è¨è¿°ãã BOM ã Spring IO Platform ã®ãã®ãã Spring Boot ã®ãã®ã«å¤æ´ãã )
æ¦è¦
è¨äºä¸è¦§ã¯ãã¡ãã§ãã
Spring Boot + npm + Geb ã§å ¥åãã©ã¼ã ãä½ã£ã¦ãã¹ããã ( ãã®ï¼ï¼ )( PMD ã 5.8.1 â 6.4.0 ã¸ãã¼ã¸ã§ã³ã¢ããããï¼ ) ã®ç¶ãã§ãã
- ä»åã®æé ã§ç¢ºèªã§ããã®ã¯ä»¥ä¸ã®å
容ã§ãã
- build.gradle ã«è¨è¿°ãã BOM 㯠Spring IO Platform ã®ãã®ãå©ç¨ãã¦ããã®ã§ããã9 April 2019 ã« EOL ã¨ãªããã¨ã決ã¾ã£ãã®ã§ Spring Boot ã® BOM ãå©ç¨ããããã«å¤æ´ãã¾ãã
åç §ãããµã¤ãã»æ¸ç±
-
Spring IO platform
http://platform.spring.io/platform/ 67. Spring Boot Gradle plugin
https://docs.spring.io/autorepo/docs/spring-boot/1.5.10.RELEASE/reference/html/build-tool-plugins-gradle-plugin.htmlSpring Boot Gradle Plugin Reference Guide
https://docs.spring.io/spring-boot/docs/2.0.2.RELEASE/gradle-plugin/reference/html/- Spring Boot 2 系㮠Spring Boot Gradle Plugin ã®ããã¥ã¢ã«ã§ããåèã«ã¡ã¢ãã¦ããã¾ãã
spring-boot-starter-parent
https://repo.spring.io/release/org/springframework/boot/spring-boot-starter-parent/spring-boot-dependencies
https://repo.spring.io/release/org/springframework/boot/spring-boot-dependencies/
ç®æ¬¡
- build.gradle ãå¤æ´ãã
- build.gradle ã® plugin ã®è¨è¿°ã
plugins { id "..." }
ã®æ¸å¼ã«å¤æ´ãã
æé
build.gradle ãå¤æ´ãã
67. Spring Boot Gradle plugin ã«è¨è¼ããã¦ããããã« Spring Boot Gradle plugin ã使ç¨ãã¦ããã° spring-boot-starter-parent ã® BOM ãèªåã§é©ç¨ãããã®ã§ãããå人çãªå¥½ã¿ã§ BOM ã¯æè¨ãããã¨ã«ãã¾ãã
build.gradle ã®ä»¥ä¸ã®ç¹ãå¤æ´ãã¾ãã
dependencyManagement { imports { // mavenBom ã¯ä»¥ä¸ã® URL ã®ãã®ã使ç¨ãã // https://repo.spring.io/release/org/springframework/boot/spring-boot-starter-parent/1.5.10.RELEASE/ // bomProperty ã«æå®å¯è½ãª property ã¯ä»¥ä¸ã® URL ã® BOM ã«è¨è¿°ããã // https://repo.spring.io/release/org/springframework/boot/spring-boot-dependencies/1.5.10.RELEASE/spring-boot-dependencies-1.5.10.RELEASE.pom mavenBom("org.springframework.boot:spring-boot-starter-parent:${springBootVersion}") { bomProperty 'thymeleaf.version', '3.0.9.RELEASE' bomProperty 'thymeleaf-extras-springsecurity4.version', '3.0.2.RELEASE' bomProperty 'thymeleaf-layout-dialect.version', '2.2.2' bomProperty 'thymeleaf-extras-data-attribute.version', '2.0.1' bomProperty 'thymeleaf-extras-java8time.version', '3.0.1.RELEASE' } } } dependencies { .......... // dependency-management-plugin ã«ãããã¼ã¸ã§ã³çªå·ãèªåã§è¨å®ãããªããã®ããããã¯ææ°ãã¼ã¸ã§ã³ãæå®ããããã® .......... compile("com.google.guava:guava:22.0") compile("org.apache.commons:commons-lang3:3.7") .......... }
mavenBom("io.spring.platform:platform-bom:Brussels-SR7")
âmavenBom("org.springframework.boot:spring-boot-starter-parent:${springBootVersion}")
ã«å¤æ´ãã¾ããbomProperty 'guava.version', '22.0'
ãåé¤ãã¾ãã- Spring Boot ã® BOM ã§ã¯ guava 㨠commons-lang3 ã¯ãµãã¼ãããã¦ããªãã®ã§ãè¨è¿°ããä½ç½®ãå¤æ´ãããã¼ã¸ã§ã³ãæè¨ãã¾ãã
compile("com.google.guava:guava")
âcompile("com.google.guava:guava:22.0")
compile("org.apache.commons:commons-lang3")
âcompile("org.apache.commons:commons-lang3:3.7")
å¤æ´å¾ãGradle Tool Window ã®å·¦ä¸ã«ãããRefresh all Gradle projectsããã¿ã³ãã¯ãªãã¯ãã¦æ´æ°ãã¾ãã
ã¢ã¸ã¥ã¼ã«ã®ãã¼ã¸ã§ã³ã確èªãã¾ããSpring Boot 㯠1.5.10.RELEASE ã使ç¨ããã¦ããã
Thymeleaf ã 3.0.9.RELEASE ã使ç¨ããã¦ãã¾ãã
clean ã¿ã¹ã¯å®è¡ â Rebuild Project å®è¡ â build ã¿ã¹ã¯ãå®è¡ãã¾ããï¼ä»¶ã ãããå¿ ã失æãããã¹ããã³ã¡ã³ãã¢ã¦ãããã« build ã¿ã¹ã¯ãå®è¡ããã®ã§ test ã¿ã¹ã¯ã¯ã¨ã©ã¼ãåºã¾ãããããã以å¤ã¯åé¡ãªãããã§ããã¾ã BOM ãå¤æ´ãããã¨ã§è¿½å ã§ãã¦ã³ãã¼ããããã¢ã¸ã¥ã¼ã«ãããã¾ããã
guava-23.5-jre.pom
ããã¦ã³ãã¼ãããã¦ããã®ã§ãããã¸ã§ã¯ãã§ä½¿ç¨ãã guava ã build.gradle ã§æå®ãã¦ãã 22.0 ã§ãªãã®ãï¼ã¨æã gradlew dependencies
ã³ãã³ããå®è¡ãã¦ç¢ºèªããã¨ããã23 ã使ç¨ãã¦ããã®ã¯ checkstyle ã§ãWeb ã¢ããªã®æ¹ã§ã¯ 22.0 ã使ç¨ããã¦ãã¾ããã
checkstyle - The Checkstyle libraries to be used for this project. \--- com.puppycrawl.tools:checkstyle:8.8 +--- antlr:antlr:2.7.7 +--- org.antlr:antlr4-runtime:4.7.1 +--- commons-beanutils:commons-beanutils:1.9.3 | \--- commons-collections:commons-collections:3.2.2 +--- commons-cli:commons-cli:1.4 +--- com.google.guava:guava:23.6-jre | +--- com.google.code.findbugs:jsr305:1.3.9 | +--- org.checkerframework:checker-compat-qual:2.0.0 | +--- com.google.errorprone:error_prone_annotations:2.1.3 | +--- com.google.j2objc:j2objc-annotations:1.1 | \--- org.codehaus.mojo:animal-sniffer-annotations:1.14 \--- net.sf.saxon:Saxon-HE:9.8.0-7 compile - Dependencies for source set 'main' (deprecated, use 'implementation ' instead). +--- org.springframework.boot:spring-boot-starter-web -> 1.5.10.RELEASE .......... +--- com.google.guava:guava:22.0 | +--- com.google.code.findbugs:jsr305:1.3.9 | +--- com.google.errorprone:error_prone_annotations:2.0.18 | +--- com.google.j2objc:j2objc-annotations:1.1 | \--- org.codehaus.mojo:animal-sniffer-annotations:1.14 +--- org.apache.commons:commons-lang3:3.7 \--- org.seasar.doma:doma:2.19.1
build.gradle ã® plugin ã®è¨è¿°ã plugins { id '...' }
ã®æ¸å¼ã«å¤æ´ãã
ä»åã®å¤æ´ã§ 67. Spring Boot Gradle plugin ãè¦ã¦ãä»ã® build.gradle ã® plugin ã®æ¸ãæ¹ãå¤ããã¨ã«æ°ã¥ããã®ã§ãæ°ããæ¸ãæ¹ã«å¤æ´ãã¾ãã
build.gradle ã®ä»¥ä¸ã®ç¹ãå¤æ´ãã¾ãã
buildscript { ext { group "ksbysample" version "1.0.1-RELEASE" springBootVersion = "1.5.10.RELEASE" } } plugins { id "java" id "eclipse" id "idea" // plugins {} block å ã§ã¯ ${springBootVersion} ã使ç¨ã§ããªãã®ã§ããã¼ã¸ã§ã³ãç´æ¥è¨è¿°ãã¦ãã id "org.springframework.boot" version "1.5.10.RELEASE" id "groovy" id "net.ltgt.errorprone" version "0.0.13" id "checkstyle" id "findbugs" id "pmd" id "com.moowork.node" version "1.2.0" } sourceCompatibility = 1.8 targetCompatibility = 1.8 ..........
buildscript { ... }
ã®åã«group ...
ãversion ...
ãè¨è¿°ãã¦ããã¨only buildscript {} and other plugins {} script blocks are allowed before plugins {} blocks, no other statements are allowed
ã¨ããã¨ã©ã¼ã¡ãã»ã¼ã¸ãåºåããã¾ãã®ã§ã以ä¸ã®ï¼è¡ãbuildscript { ext { ... } }
ã®ä¸ã«ç§»åãã¾ããgroup 'ksbysample'
version '1.0.0-RELEASE'
buildscript { ... }
å ã®repositories { ... }
ãdependencies { ... }
ãåé¤ãã¾ããapply plugin: '...'
ã®è¨è¿°å ¨ã¦ãplugins { ... }
ã§å²ã¿ãapply plugin:
âid
ã«å¤æ´ãã¾ãã- 以ä¸ã®ï¼ã¤ã®ãã©ã°ã¤ã³ã¯
version ...
ã追å ãã¾ããid "org.springframework.boot"
id "net.ltgt.errorprone"
id "com.moowork.node"
id "org.springframework.boot"
ã§ã¯ version ${springBootVersion}
ã¨è¨è¿°ãããã£ãã®ã§ãããGradle Tool Window ã®å·¦ä¸ã«ãããRefresh all Gradle projectsããã¿ã³ãã¯ãªãã¯ãã¦æ´æ°ããã¨ã¨ã©ã¼ãåºã¾ããAllow the plugin DSL to expand properties as part of the version ã«ããã¨ã¾ã å¤æ°ã¯ä½¿ç¨ã§ããªãããã§ããä»ã¯ç´æ¥è¨è¿°ããããã«ãã¾ãã
å¤æ´å¾ãGradle Tool Window ã®å·¦ä¸ã«ãããRefresh all Gradle projectsããã¿ã³ãã¯ãªãã¯ãã¦æ´æ°ãã¾ãã
clean ã¿ã¹ã¯å®è¡ â Rebuild Project å®è¡ â build ã¿ã¹ã¯ãå®è¡ã㦠BUILD SUCCESSFUL ãåºåããããã¨ã確èªãã¾ãï¼å¤±æãããã¹ãã¯ã³ã¡ã³ãã¢ã¦ããã¦ããã¾ãï¼ã
å±¥æ´
2018/06/10
åççºè¡ã