Spring Boot でログイン画面 + 一覧画面 + 登録画面の Webアプリケーションを作る ( 番外編 )( Spring Boot を 1.2.0 → 1.2.1 へバージョンアップ )
概要
Spring Boot が 1.2.1 にバージョンアップしていたので、バージョンアップします。
ソフトウェア一覧
参考にしたサイト
手順
build.gradle の変更、反映
画面左側の Project View から build.gradle をダブルクリックして開きます。
build.gradle をリンク先の内容に変更します。
画面右側の Tool Window から「Gradle」をクリックして Gradle tasks View を表示します。View 表示後、View の左上にある「Refresh Gradle projects」アイコンをクリックして、変更した build.gradle の内容を反映します。
- 更新にはしばらく時間がかかります。画面右下に進捗状況が表示されますので、進捗状況の表示が消えるまで待ちます。
Project View の External Libraries に表示される org.springframework.boot:spring-boot のバージョンが 1.2.1.RELEASE になっていることを確認します。
テスト実行、確認
src/test/java/ksbysample/webapp/basic の下の ApplicationTest.java のテストのコメントアウトを外します。
Project View の一番上の階層の ksbysample-webapp-basic を選択した後コンテキストメニューを表示し、「Run 'Tests in 'ksbysample...' with Coverage」を選択してテストを実行します。
Run View が表示されテストが実行されます。全てのテストが通り All Tests Passed のメッセージが表示されることを確認します。
src/test/java/ksbysample/webapp/basic の下の ApplicationTest.java のテストを再度コメントアウトします。
build タスク実行、確認
- Gradle tasks View から build タスクを実行し、BUILD SUCCESSFUL が表示されることを確認します。
GitHub へ commit&push
「VCS Operations」メニューが表示されます。「Commit Changes...」を選択します。
「Commit Changes」ダイアログが表示されます。Commit Message を入力後、「Commit」ボタンのドロップダウンメニューから「Commit and Push...」を選択します。
「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.RELEASE
→1.2.1.RELEASE
へ変更します。
履歴
2015/01/11
初版発行。