かんがるーさんの日記

最近自分が興味をもったものを調べた時の手順等を書いています。今は Spring Boot をいじっています。

Spring Boot で書籍の貸出状況確認・貸出申請する Web アプリケーションを作る ( 番外編 )( Git for Windows を 2.7.1 → 2.7.4 へバージョンアップ&バージョンが最新でないライブラリを最新にする )

概要

  • Git for Windows をしばらくバージョンアップしておらず、既に 2.7.4 がリリースされていましたのでバージョンアップします。
  • バージョンが最新でないライブラリを最新にします。

参照したサイト・書籍

目次

  1. Git for Windows を 2.7.0 → 2.7.1 へバージョンアップする
  2. バージョンが最新でないライブラリを最新にする

手順

Git for Windows を 2.7.0 → 2.7.1 へバージョンアップする

  1. https://git-for-windows.github.io/ の「Download」ボタンをクリックして Git-2.7.4-64-bit.exe をダウンロードします。

  2. Git-2.7.4-64-bit.exe を実行します。

  3. 「Git 2.7.4 Setup」ダイアログが表示されます。[Next >]ボタンをクリックします。

  4. 「Select Components」画面が表示されます。全てのチェックが外れたままであることを確認した後、[Next >]ボタンをクリックします。

  5. 「Adjusting your PATH environment」画面が表示されます。中央の「Use Git from the Windows Command Prompt」が選択されていることを確認後、[Next >]ボタンをクリックします。

  6. 「Configuring the line ending conversions」画面が表示されます。「Checkout Windows-style, commit Unix-style line endings」が選択されていることを確認した後、[Next >]ボタンをクリックします。

  7. 「Configuring the terminal emulator to use with Git Bash」画面が表示されます。「Use Windows'default console window」が選択されていることを確認した後、[Next >]ボタンをクリックします。

  8. 「Configuring experimental performance tweaks」画面が表示されます。何もチェックされていないことを確認した後、[Next >]ボタンをクリックします。

  9. 「Installing」画面が表示されてインストールが開始されます。

  10. インストールが完了すると「Completing the Git Setup Wizard」のメッセージが表示された画面が表示されます。中央の「View ReleaseNotes.html」のチェックを外した後、「Finish」ボタンをクリックしてインストーラーを終了します。

  11. コマンドプロンプトを起動して git のバージョンが 2.7.4 になっていることを確認します。

    f:id:ksby:20160321001938p:plain

  12. git-cmd.exe の起動も問題ないようですので、このまま 2.7.1 で作業を進めたいと思います。

    f:id:ksby:20160321002155p:plain

バージョンが最新でないライブラリを最新にする

  1. feature/121-issue ブランチを作成します。

  2. バージョン番号を指定しているライブラリの最新版を Spring IO Platform のレポジトリ ( http://repo.spring.io/repo/ ) と jCenter ( https://bintray.com/bintray/jcenter ) のサイトで確認して、最新版に更新します。build.gradle を リンク先の内容 に変更します。

  3. Gradle projects View の左上にある「Refresh all Gradle projects」ボタンをクリックして更新します。

  4. clean タスク実行 → Rebuild Project 実行 → build タスクを実行します。"BUILD SUCCESSFUL" が出力されることが確認できます。

    f:id:ksby:20160321011814p:plain

  5. Project View の src/test から Run 'All Tests' with Coverage を実行します。テストが全て成功することが確認できます。

    f:id:ksby:20160321012309p:plain

  6. 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.RELEASEio.spring.gradle:dependency-management-plugin:0.5.6.RELEASE へ変更します。
    • org.ajoberstar:grgit:1.4.1org.ajoberstar:grgit:1.5.0 へ変更します。
    • de.undercouch:gradle-download-task:2.0.0de.undercouch:gradle-download-task:2.1.0 へ変更します。
  • dependencies タスクの以下の点を変更します。
    • org.postgresql:postgresql:9.4-1204-jdbc41org.postgresql:postgresql:9.4.1208 へ変更します。
    • org.seasar.doma:doma:2.6.0org.seasar.doma:doma:2.7.0 へ変更します。
    • org.projectlombok:lombok:1.16.6org.projectlombok:lombok:1.16.8 へ変更します。
    • com.univocity:univocity-parsers:1.5.6com.univocity:univocity-parsers:2.0.0 へ変更します。
    • org.assertj:assertj-core:3.2.0org.assertj:assertj-core:3.3.0 へ変更します。
    • com.jayway.jsonpath:json-path:2.1.0com.jayway.jsonpath:json-path:2.2.0 へ変更します。
    • org.jmockit:jmockit:1.21org.jmockit:jmockit:1.22 へ変更します。
    • org.seasar.doma:doma-gen:2.6.0org.seasar.doma:doma-gen:2.7.0 へ変更します。

履歴

2016/03/21
初版発行。