かんがるーさんの日記

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

Spring Boot でログイン画面 + 一覧画面 + 登録画面の Webアプリケーションを作る ( 番外編 )( Spring Boot を 1.2.0 → 1.2.1 へバージョンアップ )

概要

Spring Boot が 1.2.1 にバージョンアップしていたので、バージョンアップします。

ソフトウェア一覧

参考にしたサイト

手順

build.gradle の変更、反映

  1. 画面左側の Project View から build.gradle をダブルクリックして開きます。

  2. build.gradle をリンク先の内容に変更します。

  3. 画面右側の Tool Window から「Gradle」をクリックして Gradle tasks View を表示します。View 表示後、View の左上にある「Refresh Gradle projects」アイコンをクリックして、変更した build.gradle の内容を反映します。

    • 更新にはしばらく時間がかかります。画面右下に進捗状況が表示されますので、進捗状況の表示が消えるまで待ちます。
  4. Project View の External Libraries に表示される org.springframework.boot:spring-boot のバージョンが 1.2.1.RELEASE になっていることを確認します。

    f:id:ksby:20150111011039p:plain

テスト実行、確認

  1. src/test/java/ksbysample/webapp/basic の下の ApplicationTest.java のテストのコメントアウトを外します。

  2. Project View の一番上の階層の ksbysample-webapp-basic を選択した後コンテキストメニューを表示し、「Run 'Tests in 'ksbysample...' with Coverage」を選択してテストを実行します。

  3. Run View が表示されテストが実行されます。全てのテストが通り All Tests Passed のメッセージが表示されることを確認します。

  4. src/test/java/ksbysample/webapp/basic の下の ApplicationTest.java のテストを再度コメントアウトします。

build タスク実行、確認

  1. Gradle tasks View から build タスクを実行し、BUILD SUCCESSFUL が表示されることを確認します。

GitHub へ commit&push

  1. メイン画面のメニューから「VCS」->「VCS Operations Popup...」を選択します。

  2. VCS Operations」メニューが表示されます。「Commit Changes...」を選択します。

  3. 「Commit Changes」ダイアログが表示されます。Commit Message を入力後、「Commit」ボタンのドロップダウンメニューから「Commit and Push...」を選択します。

  4. 「Push Commits」ダイアログが表示されます。「Push」ボタンをクリックします。

ソースコード

build.gradle

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.0.RELEASE")
        classpath("org.springframework:springloaded:1.2.1.RELEASE")
    }
}

apply plugin: 'java'
apply plugin: 'spring-boot'
apply plugin: 'idea'

jar {
    baseName = 'ksbysample-webapp-basic'
    version =  '0.0.1-SNAPSHOT'
}

idea {
    module {
        inheritOutputDirs = false
        outputDir = file("$buildDir/classes/main/")
    }
}

repositories {
    jcenter()
}

dependencies {
    compile("org.springframework.boot:spring-boot-starter-web:1.2.1.RELEASE")
    compile("org.springframework.boot:spring-boot-starter-thymeleaf")
    compile("org.springframework.boot:spring-boot-starter-data-jpa")
    compile("mysql:mysql-connector-java:5.1.34")
    compile("org.mybatis:mybatis:3.2.8")
    compile("org.mybatis:mybatis-spring:1.2.2")
    compile("org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4.1:1.16")
    compile("org.codehaus.janino:janino:2.7.5")
    compile("org.apache.commons:commons-lang3:3.3.2")
    compile("org.projectlombok:lombok:1.14.8")
    testCompile("org.springframework.boot:spring-boot-starter-test")
}

bootRun {
    jvmArgs = ['-Dspring.profiles.active=develop']
}

test {
    jvmArgs = ['-Dspring.profiles.active=develop']
}
  • dependencies 内の org.springframework.boot:spring-boot-starter-web に指定するバージョン番号を 1.2.0.RELEASE1.2.1.RELEASE へ変更します。

履歴

2015/01/11
初版発行。