Spring Boot で書籍の貸出状況確認・貸出申請する Web アプリケーションを作る ( 番外編 )( Git for Windows を 2.7.1 → 2.7.4 へバージョンアップ&バージョンが最新でないライブラリを最新にする )
概要
- Git for Windows をしばらくバージョンアップしておらず、既に 2.7.4 がリリースされていましたのでバージョンアップします。
- バージョンが最新でないライブラリを最新にします。
参照したサイト・書籍
目次
手順
Git for Windows を 2.7.0 → 2.7.1 へバージョンアップする
https://git-for-windows.github.io/ の「Download」ボタンをクリックして Git-2.7.4-64-bit.exe をダウンロードします。
Git-2.7.4-64-bit.exe を実行します。
「Git 2.7.4 Setup」ダイアログが表示されます。[Next >]ボタンをクリックします。
「Select Components」画面が表示されます。全てのチェックが外れたままであることを確認した後、[Next >]ボタンをクリックします。
「Adjusting your PATH environment」画面が表示されます。中央の「Use Git from the Windows Command Prompt」が選択されていることを確認後、[Next >]ボタンをクリックします。
「Configuring the line ending conversions」画面が表示されます。「Checkout Windows-style, commit Unix-style line endings」が選択されていることを確認した後、[Next >]ボタンをクリックします。
「Configuring the terminal emulator to use with Git Bash」画面が表示されます。「Use Windows'default console window」が選択されていることを確認した後、[Next >]ボタンをクリックします。
「Configuring experimental performance tweaks」画面が表示されます。何もチェックされていないことを確認した後、[Next >]ボタンをクリックします。
「Installing」画面が表示されてインストールが開始されます。
インストールが完了すると「Completing the Git Setup Wizard」のメッセージが表示された画面が表示されます。中央の「View ReleaseNotes.html」のチェックを外した後、「Finish」ボタンをクリックしてインストーラーを終了します。
コマンドプロンプトを起動して git のバージョンが 2.7.4 になっていることを確認します。
git-cmd.exe の起動も問題ないようですので、このまま 2.7.1 で作業を進めたいと思います。
バージョンが最新でないライブラリを最新にする
feature/121-issue ブランチを作成します。
バージョン番号を指定しているライブラリの最新版を Spring IO Platform のレポジトリ ( http://repo.spring.io/repo/ ) と jCenter ( https://bintray.com/bintray/jcenter ) のサイトで確認して、最新版に更新します。build.gradle を リンク先の内容 に変更します。
Gradle projects View の左上にある「Refresh all Gradle projects」ボタンをクリックして更新します。
clean タスク実行 → Rebuild Project 実行 → build タスクを実行します。"BUILD SUCCESSFUL" が出力されることが確認できます。
Project View の src/test から Run 'All Tests' with Coverage を実行します。テストが全て成功することが確認できます。
commit、GitHub へ Push、feature/121-issue -> 1.0.x へ Pull Request、1.0.x でマージ、feature/121-issue ブランチを削除、をします。
ソースコード
build.gradle
buildscript { ext { springBootVersion = '1.2.8.RELEASE' } repositories { jcenter() maven { url "http://repo.spring.io/repo/" } } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") classpath("io.spring.gradle:dependency-management-plugin:0.5.6.RELEASE") // for Grgit classpath("org.ajoberstar:grgit:1.5.0") // Gradle Download Task classpath("de.undercouch:gradle-download-task:2.1.0") } } .......... dependencies { def jdbcDriver = "org.postgresql:postgresql:9.4.1208" // spring-boot-gradle-plugin によりバージョン番号が自動で設定されるもの // Appendix E. Dependency versions ( http://docs.spring.io/spring-boot/docs/current/reference/html/appendix-dependency-versions.html ) 参照 compile("org.springframework.boot:spring-boot-starter-web") compile("org.springframework.boot:spring-boot-starter-thymeleaf") compile("org.thymeleaf.extras:thymeleaf-extras-springsecurity3") compile("org.springframework.boot:spring-boot-starter-data-jpa") compile("org.springframework.boot:spring-boot-starter-velocity") compile("org.springframework.boot:spring-boot-starter-mail") compile("org.springframework.boot:spring-boot-starter-security") compile("org.springframework.boot:spring-boot-starter-redis") compile("org.springframework.boot:spring-boot-starter-amqp") compile("org.codehaus.janino:janino") compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") testCompile("org.springframework.boot:spring-boot-starter-test") // (ここから) gradle でテストを実行した場合に spring-security-test-4.0.3.RELEASE.jar しか classpath に指定されず // テストが失敗したため、3.2.9.RELEASE を明記している testCompile("org.springframework.security:spring-security-core:3.2.9.RELEASE") testCompile("org.springframework.security:spring-security-web:3.2.9.RELEASE") // (ここまで) ------------------------------------------------------------------------------------------------------ testCompile("org.springframework.security:spring-security-test:4.0.2.RELEASE") testCompile("org.yaml:snakeyaml") testCompile("org.codehaus.groovy:groovy-all") testCompile("org.spockframework:spock-core") testCompile("org.spockframework:spock-spring") // spring-boot-gradle-plugin によりバージョン番号が自動で設定されないもの compile("${jdbcDriver}") compile("org.seasar.doma:doma:2.7.0") compile("org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4.1:1.16") compile("org.apache.commons:commons-lang3:3.4") compile("org.projectlombok:lombok:1.16.8") compile("com.google.guava:guava:19.0") compile("org.springframework.session:spring-session:1.0.1.RELEASE") compile("org.simpleframework:simple-xml:2.7.1") compile("com.univocity:univocity-parsers:2.0.0") compile("org.thymeleaf.extras:thymeleaf-extras-java8time:2.1.0.RELEASE") testCompile("org.dbunit:dbunit:2.5.1") testCompile("com.icegreen:greenmail:1.4.1") testCompile("org.assertj:assertj-core:3.3.0") testCompile("com.jayway.jsonpath:json-path:2.2.0") testCompile("org.jmockit:jmockit:1.22") // for Doma-Gen domaGenRuntime("org.seasar.doma:doma-gen:2.7.0") domaGenRuntime("${jdbcDriver}") }
- buildscript タスクの以下の点を変更します。
io.spring.gradle:dependency-management-plugin:0.5.3.RELEASE
→io.spring.gradle:dependency-management-plugin:0.5.6.RELEASE
へ変更します。org.ajoberstar:grgit:1.4.1
→org.ajoberstar:grgit:1.5.0
へ変更します。de.undercouch:gradle-download-task:2.0.0
→de.undercouch:gradle-download-task:2.1.0
へ変更します。
- dependencies タスクの以下の点を変更します。
org.postgresql:postgresql:9.4-1204-jdbc41
→org.postgresql:postgresql:9.4.1208
へ変更します。org.seasar.doma:doma:2.6.0
→org.seasar.doma:doma:2.7.0
へ変更します。org.projectlombok:lombok:1.16.6
→org.projectlombok:lombok:1.16.8
へ変更します。com.univocity:univocity-parsers:1.5.6
→com.univocity:univocity-parsers:2.0.0
へ変更します。org.assertj:assertj-core:3.2.0
→org.assertj:assertj-core:3.3.0
へ変更します。com.jayway.jsonpath:json-path:2.1.0
→com.jayway.jsonpath:json-path:2.2.0
へ変更します。org.jmockit:jmockit:1.21
→org.jmockit:jmockit:1.22
へ変更します。org.seasar.doma:doma-gen:2.6.0
→org.seasar.doma:doma-gen:2.7.0
へ変更します。
履歴
2016/03/21
初版発行。