This repository was archived by the owner on Jun 29, 2021. It is now read-only.

Repository files navigation

Spring Boot + Gradle template

Build Statusbuild statuswercker status

Spring Boot , Gradle で開発する際のテンプレートです。

現在提供している機能:

  • SpringSecurity による独自テーブルを利用したログイン処理(パスワードはハッシュ化)。

  • トランザクション管理(システムエラー時ロールバック)

  • 共通のログ出力処理(操作ログ、システムエラーログ、SQL(trace,debug))

  • テストコードサンプル

    • SpringSecurity
    • コントローラに対するテスト
  • コントロールサンプル

    • DateTimePicker : 日付選択(日付のみ、時刻のみ、両方)
    • typeahead : サジェスト機能のようなもの
    • Modal(Bootstrap) ※サブミット非対応
    • bootstrap-dialog : アラート表示
    • bootstrap-switch : スイッチ(トグルスイッチ)
    • bootstrap-tagsinput : タグ入力(typeahead との組み合わせのサンプル)
  • マスタサンプル(ORM:Mybatis)

    • User : バリデーション、カスタムバリデーションサンプル
    • Company : Mybatis XML サンプル
  • etc

    • 入力値検証サンプル : 独自アノテーション(単独、相関チェック)

依存関係

Core(Spring Boot 1.5.3.RELEASE):

対象バージョン内容
org.springframework.boot:spring-boot-starter-data-jpa※1JPA
org.springframework.boot:spring-boot-starter-security※1Spring Security
org.springframework.boot:spring-boot-starter-web※1Spring MVC
org.springframework.boot:spring-boot-starter-thymeleaf※1Template engine
org.springframework.boot:spring-boot-starter-log4j2※1Logging
org.thymeleaf.extras:thymeleaf-extras-springsecurity43.0.1.RELEASETemplate engine Spring Security 拡張
org.thymeleaf.extras:thymeleaf-extras-conditionalcomments※1Template engine IE Conditional comments 拡張
org.mybatis.spring.boot:mybatis-spring-boot-starter1.3.0Spring Boot <-> ORM

※1 Core のバージョンに依存。

Webjars:

http://www.webjars.org/
(※非力な PC だと表示に時間がかかるので注意)

対象バージョン内容または URL
webjars-locator0.32WebJar バージョン番号管理(隠蔽で利用)
jquery2.2.4jQuery 2.2.4 (※2)
bootstrap3.3.7-1Bootstrap 3.3.7
html5shiv3.7.3Bootstrap の IE8 対応用 (HTML5) ※後々削除予定
respond.js1.4.2Bootstrap の IE8 対応用(レスポンシブ) ※後々削除予定
font-awesome4.6.3Font Awesome
Eonasdan-bootstrap-datetimepicker4.17.37-1bootstrap-DateTimePicker(Bootstrap,jQuery, moment.js(※3) 必須)
sticky-footer0.1.4フッター表示
bootswatch3.3.2Bootstrap のテーマ拡張(Lumen を適用) bootswatch 3.3.7 は依存性に問題が発生
typeaheadjs0.11.1https://twitter.github.io/typeahead.js/
hoganjs3.0.2http://twitter.github.io/hogan.js/ typeahead 内部で html テンプレートエンジンとして利用。
bootstrap-dialog1.34.6http://nakupanda.github.io/bootstrap3-dialog/ JavaScript のみで生成可能なダイアログ
Bootstrap-3-Typeahead3.1.1https://github.com/bassjobsen/Bootstrap-3-Typeahead bootstrap-tagsinput で利用、 typeaheadjs と共存可能

※2 jQuery を必要とするモジュールが 3 系 に対応していないものが多くフロント全般に影響する為、 2 系にした。
※3 Eonasdan-bootstrap-datetimepicker の依存関係として moment.js の webjars がダウンロードされます。(バージョン指定が必要な場合は、個別に定義が必要です。)

ext:

対象内容
ext['thymeleaf.version'] = '3.0.5.RELEASE'Thymeleaf version 3 を利用する設定、Spring Boot 1.4.x.RELEASE のデフォルトは version2 がデフォルト
ext['thymeleaf-layout-dialect.version'] = '2.1.2'Thymeleaf version 3 からは dialect の指定が必要。

etc:

対象バージョン内容または URL
org.springframework.boot:spring-boot-starter-tomcat※1Tomcat ランタイム
webapp-runner8.5.5.0ランチャーアプリケーション Heroku で war を起動させるために利用
com.h2database:h2※1H2 Database ランタイム
org.springframework.boot:spring-boot-starter-test※1SpringBoot test
org.springframework.security:spring-security-test※1SpringBoot Security
org.dbunit:dbunit2.5.3DB Test

SOAP:

対象バージョン内容または URL
org.springframework.boot:spring-boot-starter-web-services※1SpringBoot SOAP
wsdl4j1.6.3WSDL

SOAP client (cURL example):

curl --header "content-type: text/xml" -d @src/test/resources/ws/requestDpt.xml http://localhost:8080/ws/dpt

or (Heroku)

curl --header "content-type: text/xml" -d @src/test/resources/ws/requestDpt.xml http://springboottemplate.herokuapp.com/ws/dpt

REST:

対象バージョン内容または URL
jackson-dataformat-xml2.8.3XML

JSON:

http://localhost:8080/rest/dpt/json/1000
or (Heroku)
http://springboottemplate.herokuapp.com/rest/dpt/json/1000

XML:

http://localhost:8080/rest/dpt/xml/1000
or (Heroku)
http://springboottemplate.herokuapp.com/rest/dpt/xml/1000

CDN

http://www.jsdelivr.com
Thymeleaf の ローカル(AP 経由しない)での表示の際で WebJars と同じバージョンを調査する場合に利用。

動作環境

2016.08.08 現在

  • JDK 8 (8u101)

動作方法

  1. ダウンロード後、解凍し develop-spring-template-master ディレクトリ直下へコンソールで移動。
  2. 「 gradlew 」 を実行( Windows の方は gradlew.bat をダブルクリックでも可)。
  3. ブラウザを立ち上げて 「 http://localhost:8080 」 にアクセス。
    ※終了時は強制終了させてください。

認証情報

ログインIDパスワード
testtestpass

※SpringSecurity のロールはありません。

etc:

Heroku

Heroku

こちらは実験的です、予告なく停止する場合があります。
ローカルで実行しなくてもサンプルが確認できます。

https://springboottemplate.herokuapp.com/
※ Application Error が表示されている場合、 Free dyno の制限になっている可能性があります。
Heroku 無料プラン(Free dyno) を利用しています。
(24 時間の内、6 時間は Sleep 状態にしなければならないという制限があります。)
https://blog.heroku.com/new-dyno-types-public-beta#hobby-and-free-dynos

CI サービス

無料でどこまで利用できるか検証用に利用しています。
(ビルドが目的で Gradle が利用できる前提となります。)
現在検証中は下記サービスです。

Code Coverage

Codacy BadgeCodacy Badge

Codacy の静的解析は Codacy のみで結果を確認できます。
Coverage は Codacy から確認する場合、JaCoCo と JaCoCo のCoverage 結果を送信する仕組みが必要になります(Circle CI からアップロードする仕組みにしています)。

About

SpringBoot template(Spring MVC, Spring Security, WebJars, Thymeleaf, MyBatis)

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
This repository was archived by the owner on Jun 29, 2021. It is now read-only.

Repository files navigation

Spring Boot + Gradle template

Build Statusbuild statuswercker status

Spring Boot , Gradle で開発する際のテンプレートです。

現在提供している機能:

  • SpringSecurity による独自テーブルを利用したログイン処理(パスワードはハッシュ化)。

  • トランザクション管理(システムエラー時ロールバック)

  • 共通のログ出力処理(操作ログ、システムエラーログ、SQL(trace,debug))

  • テストコードサンプル

    • SpringSecurity
    • コントローラに対するテスト
  • コントロールサンプル

    • DateTimePicker : 日付選択(日付のみ、時刻のみ、両方)
    • typeahead : サジェスト機能のようなもの
    • Modal(Bootstrap) ※サブミット非対応
    • bootstrap-dialog : アラート表示
    • bootstrap-switch : スイッチ(トグルスイッチ)
    • bootstrap-tagsinput : タグ入力(typeahead との組み合わせのサンプル)
  • マスタサンプル(ORM:Mybatis)

    • User : バリデーション、カスタムバリデーションサンプル
    • Company : Mybatis XML サンプル
  • etc

    • 入力値検証サンプル : 独自アノテーション(単独、相関チェック)

依存関係

Core(Spring Boot 1.5.3.RELEASE):

対象バージョン内容
org.springframework.boot:spring-boot-starter-data-jpa※1JPA
org.springframework.boot:spring-boot-starter-security※1Spring Security
org.springframework.boot:spring-boot-starter-web※1Spring MVC
org.springframework.boot:spring-boot-starter-thymeleaf※1Template engine
org.springframework.boot:spring-boot-starter-log4j2※1Logging
org.thymeleaf.extras:thymeleaf-extras-springsecurity43.0.1.RELEASETemplate engine Spring Security 拡張
org.thymeleaf.extras:thymeleaf-extras-conditionalcomments※1Template engine IE Conditional comments 拡張
org.mybatis.spring.boot:mybatis-spring-boot-starter1.3.0Spring Boot <-> ORM

※1 Core のバージョンに依存。

Webjars:

http://www.webjars.org/
(※非力な PC だと表示に時間がかかるので注意)

対象バージョン内容または URL
webjars-locator0.32WebJar バージョン番号管理(隠蔽で利用)
jquery2.2.4jQuery 2.2.4 (※2)
bootstrap3.3.7-1Bootstrap 3.3.7
html5shiv3.7.3Bootstrap の IE8 対応用 (HTML5) ※後々削除予定
respond.js1.4.2Bootstrap の IE8 対応用(レスポンシブ) ※後々削除予定
font-awesome4.6.3Font Awesome
Eonasdan-bootstrap-datetimepicker4.17.37-1bootstrap-DateTimePicker(Bootstrap,jQuery, moment.js(※3) 必須)
sticky-footer0.1.4フッター表示
bootswatch3.3.2Bootstrap のテーマ拡張(Lumen を適用) bootswatch 3.3.7 は依存性に問題が発生
typeaheadjs0.11.1https://twitter.github.io/typeahead.js/
hoganjs3.0.2http://twitter.github.io/hogan.js/ typeahead 内部で html テンプレートエンジンとして利用。
bootstrap-dialog1.34.6http://nakupanda.github.io/bootstrap3-dialog/ JavaScript のみで生成可能なダイアログ
Bootstrap-3-Typeahead3.1.1https://github.com/bassjobsen/Bootstrap-3-Typeahead bootstrap-tagsinput で利用、 typeaheadjs と共存可能

※2 jQuery を必要とするモジュールが 3 系 に対応していないものが多くフロント全般に影響する為、 2 系にした。
※3 Eonasdan-bootstrap-datetimepicker の依存関係として moment.js の webjars がダウンロードされます。(バージョン指定が必要な場合は、個別に定義が必要です。)

ext:

対象内容
ext['thymeleaf.version'] = '3.0.5.RELEASE'Thymeleaf version 3 を利用する設定、Spring Boot 1.4.x.RELEASE のデフォルトは version2 がデフォルト
ext['thymeleaf-layout-dialect.version'] = '2.1.2'Thymeleaf version 3 からは dialect の指定が必要。

etc:

対象バージョン内容または URL
org.springframework.boot:spring-boot-starter-tomcat※1Tomcat ランタイム
webapp-runner8.5.5.0ランチャーアプリケーション Heroku で war を起動させるために利用
com.h2database:h2※1H2 Database ランタイム
org.springframework.boot:spring-boot-starter-test※1SpringBoot test
org.springframework.security:spring-security-test※1SpringBoot Security
org.dbunit:dbunit2.5.3DB Test

SOAP:

対象バージョン内容または URL
org.springframework.boot:spring-boot-starter-web-services※1SpringBoot SOAP
wsdl4j1.6.3WSDL

SOAP client (cURL example):

curl --header "content-type: text/xml" -d @src/test/resources/ws/requestDpt.xml http://localhost:8080/ws/dpt

or (Heroku)

curl --header "content-type: text/xml" -d @src/test/resources/ws/requestDpt.xml http://springboottemplate.herokuapp.com/ws/dpt

REST:

対象バージョン内容または URL
jackson-dataformat-xml2.8.3XML

JSON:

http://localhost:8080/rest/dpt/json/1000
or (Heroku)
http://springboottemplate.herokuapp.com/rest/dpt/json/1000

XML:

http://localhost:8080/rest/dpt/xml/1000
or (Heroku)
http://springboottemplate.herokuapp.com/rest/dpt/xml/1000

CDN

http://www.jsdelivr.com
Thymeleaf の ローカル(AP 経由しない)での表示の際で WebJars と同じバージョンを調査する場合に利用。

動作環境

2016.08.08 現在

  • JDK 8 (8u101)

動作方法

  1. ダウンロード後、解凍し develop-spring-template-master ディレクトリ直下へコンソールで移動。
  2. 「 gradlew 」 を実行( Windows の方は gradlew.bat をダブルクリックでも可)。
  3. ブラウザを立ち上げて 「 http://localhost:8080 」 にアクセス。
    ※終了時は強制終了させてください。

認証情報

ログインIDパスワード
testtestpass

※SpringSecurity のロールはありません。

etc:

Heroku

Heroku

こちらは実験的です、予告なく停止する場合があります。
ローカルで実行しなくてもサンプルが確認できます。

https://springboottemplate.herokuapp.com/
※ Application Error が表示されている場合、 Free dyno の制限になっている可能性があります。
Heroku 無料プラン(Free dyno) を利用しています。
(24 時間の内、6 時間は Sleep 状態にしなければならないという制限があります。)
https://blog.heroku.com/new-dyno-types-public-beta#hobby-and-free-dynos

CI サービス

無料でどこまで利用できるか検証用に利用しています。
(ビルドが目的で Gradle が利用できる前提となります。)
現在検証中は下記サービスです。

Code Coverage

Codacy BadgeCodacy Badge

Codacy の静的解析は Codacy のみで結果を確認できます。
Coverage は Codacy から確認する場合、JaCoCo と JaCoCo のCoverage 結果を送信する仕組みが必要になります(Circle CI からアップロードする仕組みにしています)。

About

SpringBoot template(Spring MVC, Spring Security, WebJars, Thymeleaf, MyBatis)

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Jun 29, 2021. It is now read-only.

Repository files navigation

Spring Boot + Gradle template

Build Statusbuild statuswercker status

Spring Boot , Gradle で開発する際のテンプレートです。

現在提供している機能:

  • SpringSecurity による独自テーブルを利用したログイン処理(パスワードはハッシュ化)。

  • トランザクション管理(システムエラー時ロールバック)

  • 共通のログ出力処理(操作ログ、システムエラーログ、SQL(trace,debug))

  • テストコードサンプル

    • SpringSecurity
    • コントローラに対するテスト
  • コントロールサンプル

    • DateTimePicker : 日付選択(日付のみ、時刻のみ、両方)
    • typeahead : サジェスト機能のようなもの
    • Modal(Bootstrap) ※サブミット非対応
    • bootstrap-dialog : アラート表示
    • bootstrap-switch : スイッチ(トグルスイッチ)
    • bootstrap-tagsinput : タグ入力(typeahead との組み合わせのサンプル)
  • マスタサンプル(ORM:Mybatis)

    • User : バリデーション、カスタムバリデーションサンプル
    • Company : Mybatis XML サンプル
  • etc

    • 入力値検証サンプル : 独自アノテーション(単独、相関チェック)

依存関係

Core(Spring Boot 1.5.3.RELEASE):

対象バージョン内容
org.springframework.boot:spring-boot-starter-data-jpa※1JPA
org.springframework.boot:spring-boot-starter-security※1Spring Security
org.springframework.boot:spring-boot-starter-web※1Spring MVC
org.springframework.boot:spring-boot-starter-thymeleaf※1Template engine
org.springframework.boot:spring-boot-starter-log4j2※1Logging
org.thymeleaf.extras:thymeleaf-extras-springsecurity43.0.1.RELEASETemplate engine Spring Security 拡張
org.thymeleaf.extras:thymeleaf-extras-conditionalcomments※1Template engine IE Conditional comments 拡張
org.mybatis.spring.boot:mybatis-spring-boot-starter1.3.0Spring Boot <-> ORM

※1 Core のバージョンに依存。

Webjars:

http://www.webjars.org/
(※非力な PC だと表示に時間がかかるので注意)

対象バージョン内容または URL
webjars-locator0.32WebJar バージョン番号管理(隠蔽で利用)
jquery2.2.4jQuery 2.2.4 (※2)
bootstrap3.3.7-1Bootstrap 3.3.7
html5shiv3.7.3Bootstrap の IE8 対応用 (HTML5) ※後々削除予定
respond.js1.4.2Bootstrap の IE8 対応用(レスポンシブ) ※後々削除予定
font-awesome4.6.3Font Awesome
Eonasdan-bootstrap-datetimepicker4.17.37-1bootstrap-DateTimePicker(Bootstrap,jQuery, moment.js(※3) 必須)
sticky-footer0.1.4フッター表示
bootswatch3.3.2Bootstrap のテーマ拡張(Lumen を適用) bootswatch 3.3.7 は依存性に問題が発生
typeaheadjs0.11.1https://twitter.github.io/typeahead.js/
hoganjs3.0.2http://twitter.github.io/hogan.js/ typeahead 内部で html テンプレートエンジンとして利用。
bootstrap-dialog1.34.6http://nakupanda.github.io/bootstrap3-dialog/ JavaScript のみで生成可能なダイアログ
Bootstrap-3-Typeahead3.1.1https://github.com/bassjobsen/Bootstrap-3-Typeahead bootstrap-tagsinput で利用、 typeaheadjs と共存可能

※2 jQuery を必要とするモジュールが 3 系 に対応していないものが多くフロント全般に影響する為、 2 系にした。
※3 Eonasdan-bootstrap-datetimepicker の依存関係として moment.js の webjars がダウンロードされます。(バージョン指定が必要な場合は、個別に定義が必要です。)

ext:

対象内容
ext['thymeleaf.version'] = '3.0.5.RELEASE'Thymeleaf version 3 を利用する設定、Spring Boot 1.4.x.RELEASE のデフォルトは version2 がデフォルト
ext['thymeleaf-layout-dialect.version'] = '2.1.2'Thymeleaf version 3 からは dialect の指定が必要。

etc:

対象バージョン内容または URL
org.springframework.boot:spring-boot-starter-tomcat※1Tomcat ランタイム
webapp-runner8.5.5.0ランチャーアプリケーション Heroku で war を起動させるために利用
com.h2database:h2※1H2 Database ランタイム
org.springframework.boot:spring-boot-starter-test※1SpringBoot test
org.springframework.security:spring-security-test※1SpringBoot Security
org.dbunit:dbunit2.5.3DB Test

SOAP:

対象バージョン内容または URL
org.springframework.boot:spring-boot-starter-web-services※1SpringBoot SOAP
wsdl4j1.6.3WSDL

SOAP client (cURL example):

curl --header "content-type: text/xml" -d @src/test/resources/ws/requestDpt.xml http://localhost:8080/ws/dpt

or (Heroku)

curl --header "content-type: text/xml" -d @src/test/resources/ws/requestDpt.xml http://springboottemplate.herokuapp.com/ws/dpt

REST:

対象バージョン内容または URL
jackson-dataformat-xml2.8.3XML

JSON:

http://localhost:8080/rest/dpt/json/1000
or (Heroku)
http://springboottemplate.herokuapp.com/rest/dpt/json/1000

XML:

http://localhost:8080/rest/dpt/xml/1000
or (Heroku)
http://springboottemplate.herokuapp.com/rest/dpt/xml/1000

CDN

http://www.jsdelivr.com
Thymeleaf の ローカル(AP 経由しない)での表示の際で WebJars と同じバージョンを調査する場合に利用。

動作環境

2016.08.08 現在

  • JDK 8 (8u101)

動作方法

  1. ダウンロード後、解凍し develop-spring-template-master ディレクトリ直下へコンソールで移動。
  2. 「 gradlew 」 を実行( Windows の方は gradlew.bat をダブルクリックでも可)。
  3. ブラウザを立ち上げて 「 http://localhost:8080 」 にアクセス。
    ※終了時は強制終了させてください。

認証情報

ログインIDパスワード
testtestpass

※SpringSecurity のロールはありません。

etc:

Heroku

Heroku

こちらは実験的です、予告なく停止する場合があります。
ローカルで実行しなくてもサンプルが確認できます。

https://springboottemplate.herokuapp.com/
※ Application Error が表示されている場合、 Free dyno の制限になっている可能性があります。
Heroku 無料プラン(Free dyno) を利用しています。
(24 時間の内、6 時間は Sleep 状態にしなければならないという制限があります。)
https://blog.heroku.com/new-dyno-types-public-beta#hobby-and-free-dynos

CI サービス

無料でどこまで利用できるか検証用に利用しています。
(ビルドが目的で Gradle が利用できる前提となります。)
現在検証中は下記サービスです。

Code Coverage

Codacy BadgeCodacy Badge

Codacy の静的解析は Codacy のみで結果を確認できます。
Coverage は Codacy から確認する場合、JaCoCo と JaCoCo のCoverage 結果を送信する仕組みが必要になります(Circle CI からアップロードする仕組みにしています)。

About

SpringBoot template(Spring MVC, Spring Security, WebJars, Thymeleaf, MyBatis)

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Jun 29, 2021. It is now read-only.

Repository files navigation

Spring Boot + Gradle template

Build Statusbuild statuswercker status

Spring Boot , Gradle で開発する際のテンプレートです。

現在提供している機能:

  • SpringSecurity による独自テーブルを利用したログイン処理(パスワードはハッシュ化)。

  • トランザクション管理(システムエラー時ロールバック)

  • 共通のログ出力処理(操作ログ、システムエラーログ、SQL(trace,debug))

  • テストコードサンプル

    • SpringSecurity
    • コントローラに対するテスト
  • コントロールサンプル

    • DateTimePicker : 日付選択(日付のみ、時刻のみ、両方)
    • typeahead : サジェスト機能のようなもの
    • Modal(Bootstrap) ※サブミット非対応
    • bootstrap-dialog : アラート表示
    • bootstrap-switch : スイッチ(トグルスイッチ)
    • bootstrap-tagsinput : タグ入力(typeahead との組み合わせのサンプル)
  • マスタサンプル(ORM:Mybatis)

    • User : バリデーション、カスタムバリデーションサンプル
    • Company : Mybatis XML サンプル
  • etc

    • 入力値検証サンプル : 独自アノテーション(単独、相関チェック)

依存関係

Core(Spring Boot 1.5.3.RELEASE):

対象バージョン内容
org.springframework.boot:spring-boot-starter-data-jpa※1JPA
org.springframework.boot:spring-boot-starter-security※1Spring Security
org.springframework.boot:spring-boot-starter-web※1Spring MVC
org.springframework.boot:spring-boot-starter-thymeleaf※1Template engine
org.springframework.boot:spring-boot-starter-log4j2※1Logging
org.thymeleaf.extras:thymeleaf-extras-springsecurity43.0.1.RELEASETemplate engine Spring Security 拡張
org.thymeleaf.extras:thymeleaf-extras-conditionalcomments※1Template engine IE Conditional comments 拡張
org.mybatis.spring.boot:mybatis-spring-boot-starter1.3.0Spring Boot <-> ORM

※1 Core のバージョンに依存。

Webjars:

http://www.webjars.org/
(※非力な PC だと表示に時間がかかるので注意)

対象バージョン内容または URL
webjars-locator0.32WebJar バージョン番号管理(隠蔽で利用)
jquery2.2.4jQuery 2.2.4 (※2)
bootstrap3.3.7-1Bootstrap 3.3.7
html5shiv3.7.3Bootstrap の IE8 対応用 (HTML5) ※後々削除予定
respond.js1.4.2Bootstrap の IE8 対応用(レスポンシブ) ※後々削除予定
font-awesome4.6.3Font Awesome
Eonasdan-bootstrap-datetimepicker4.17.37-1bootstrap-DateTimePicker(Bootstrap,jQuery, moment.js(※3) 必須)
sticky-footer0.1.4フッター表示
bootswatch3.3.2Bootstrap のテーマ拡張(Lumen を適用) bootswatch 3.3.7 は依存性に問題が発生
typeaheadjs0.11.1https://twitter.github.io/typeahead.js/
hoganjs3.0.2http://twitter.github.io/hogan.js/ typeahead 内部で html テンプレートエンジンとして利用。
bootstrap-dialog1.34.6http://nakupanda.github.io/bootstrap3-dialog/ JavaScript のみで生成可能なダイアログ
Bootstrap-3-Typeahead3.1.1https://github.com/bassjobsen/Bootstrap-3-Typeahead bootstrap-tagsinput で利用、 typeaheadjs と共存可能

※2 jQuery を必要とするモジュールが 3 系 に対応していないものが多くフロント全般に影響する為、 2 系にした。
※3 Eonasdan-bootstrap-datetimepicker の依存関係として moment.js の webjars がダウンロードされます。(バージョン指定が必要な場合は、個別に定義が必要です。)

ext:

対象内容
ext['thymeleaf.version'] = '3.0.5.RELEASE'Thymeleaf version 3 を利用する設定、Spring Boot 1.4.x.RELEASE のデフォルトは version2 がデフォルト
ext['thymeleaf-layout-dialect.version'] = '2.1.2'Thymeleaf version 3 からは dialect の指定が必要。

etc:

対象バージョン内容または URL
org.springframework.boot:spring-boot-starter-tomcat※1Tomcat ランタイム
webapp-runner8.5.5.0ランチャーアプリケーション Heroku で war を起動させるために利用
com.h2database:h2※1H2 Database ランタイム
org.springframework.boot:spring-boot-starter-test※1SpringBoot test
org.springframework.security:spring-security-test※1SpringBoot Security
org.dbunit:dbunit2.5.3DB Test

SOAP:

対象バージョン内容または URL
org.springframework.boot:spring-boot-starter-web-services※1SpringBoot SOAP
wsdl4j1.6.3WSDL

SOAP client (cURL example):

curl --header "content-type: text/xml" -d @src/test/resources/ws/requestDpt.xml http://localhost:8080/ws/dpt

or (Heroku)

curl --header "content-type: text/xml" -d @src/test/resources/ws/requestDpt.xml http://springboottemplate.herokuapp.com/ws/dpt

REST:

対象バージョン内容または URL
jackson-dataformat-xml2.8.3XML

JSON:

http://localhost:8080/rest/dpt/json/1000
or (Heroku)
http://springboottemplate.herokuapp.com/rest/dpt/json/1000

XML:

http://localhost:8080/rest/dpt/xml/1000
or (Heroku)
http://springboottemplate.herokuapp.com/rest/dpt/xml/1000

CDN

http://www.jsdelivr.com
Thymeleaf の ローカル(AP 経由しない)での表示の際で WebJars と同じバージョンを調査する場合に利用。

動作環境

2016.08.08 現在

  • JDK 8 (8u101)

動作方法

  1. ダウンロード後、解凍し develop-spring-template-master ディレクトリ直下へコンソールで移動。
  2. 「 gradlew 」 を実行( Windows の方は gradlew.bat をダブルクリックでも可)。
  3. ブラウザを立ち上げて 「 http://localhost:8080 」 にアクセス。
    ※終了時は強制終了させてください。

認証情報

ログインIDパスワード
testtestpass

※SpringSecurity のロールはありません。

etc:

Heroku

Heroku

こちらは実験的です、予告なく停止する場合があります。
ローカルで実行しなくてもサンプルが確認できます。

https://springboottemplate.herokuapp.com/
※ Application Error が表示されている場合、 Free dyno の制限になっている可能性があります。
Heroku 無料プラン(Free dyno) を利用しています。
(24 時間の内、6 時間は Sleep 状態にしなければならないという制限があります。)
https://blog.heroku.com/new-dyno-types-public-beta#hobby-and-free-dynos

CI サービス

無料でどこまで利用できるか検証用に利用しています。
(ビルドが目的で Gradle が利用できる前提となります。)
現在検証中は下記サービスです。

Code Coverage

Codacy BadgeCodacy Badge

Codacy の静的解析は Codacy のみで結果を確認できます。
Coverage は Codacy から確認する場合、JaCoCo と JaCoCo のCoverage 結果を送信する仕組みが必要になります(Circle CI からアップロードする仕組みにしています)。

About

SpringBoot template(Spring MVC, Spring Security, WebJars, Thymeleaf, MyBatis)

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
This repository was archived by the owner on Jun 29, 2021. It is now read-only.

Repository files navigation

Spring Boot + Gradle template

Build Statusbuild statuswercker status

Spring Boot , Gradle で開発する際のテンプレートです。

現在提供している機能:

  • SpringSecurity による独自テーブルを利用したログイン処理(パスワードはハッシュ化)。

  • トランザクション管理(システムエラー時ロールバック)

  • 共通のログ出力処理(操作ログ、システムエラーログ、SQL(trace,debug))

  • テストコードサンプル

    • SpringSecurity
    • コントローラに対するテスト
  • コントロールサンプル

    • DateTimePicker : 日付選択(日付のみ、時刻のみ、両方)
    • typeahead : サジェスト機能のようなもの
    • Modal(Bootstrap) ※サブミット非対応
    • bootstrap-dialog : アラート表示
    • bootstrap-switch : スイッチ(トグルスイッチ)
    • bootstrap-tagsinput : タグ入力(typeahead との組み合わせのサンプル)
  • マスタサンプル(ORM:Mybatis)

    • User : バリデーション、カスタムバリデーションサンプル
    • Company : Mybatis XML サンプル
  • etc

    • 入力値検証サンプル : 独自アノテーション(単独、相関チェック)

依存関係

Core(Spring Boot 1.5.3.RELEASE):

対象バージョン内容
org.springframework.boot:spring-boot-starter-data-jpa※1JPA
org.springframework.boot:spring-boot-starter-security※1Spring Security
org.springframework.boot:spring-boot-starter-web※1Spring MVC
org.springframework.boot:spring-boot-starter-thymeleaf※1Template engine
org.springframework.boot:spring-boot-starter-log4j2※1Logging
org.thymeleaf.extras:thymeleaf-extras-springsecurity43.0.1.RELEASETemplate engine Spring Security 拡張
org.thymeleaf.extras:thymeleaf-extras-conditionalcomments※1Template engine IE Conditional comments 拡張
org.mybatis.spring.boot:mybatis-spring-boot-starter1.3.0Spring Boot <-> ORM

※1 Core のバージョンに依存。

Webjars:

http://www.webjars.org/
(※非力な PC だと表示に時間がかかるので注意)

対象バージョン内容または URL
webjars-locator0.32WebJar バージョン番号管理(隠蔽で利用)
jquery2.2.4jQuery 2.2.4 (※2)
bootstrap3.3.7-1Bootstrap 3.3.7
html5shiv3.7.3Bootstrap の IE8 対応用 (HTML5) ※後々削除予定
respond.js1.4.2Bootstrap の IE8 対応用(レスポンシブ) ※後々削除予定
font-awesome4.6.3Font Awesome
Eonasdan-bootstrap-datetimepicker4.17.37-1bootstrap-DateTimePicker(Bootstrap,jQuery, moment.js(※3) 必須)
sticky-footer0.1.4フッター表示
bootswatch3.3.2Bootstrap のテーマ拡張(Lumen を適用) bootswatch 3.3.7 は依存性に問題が発生
typeaheadjs0.11.1https://twitter.github.io/typeahead.js/
hoganjs3.0.2http://twitter.github.io/hogan.js/ typeahead 内部で html テンプレートエンジンとして利用。
bootstrap-dialog1.34.6http://nakupanda.github.io/bootstrap3-dialog/ JavaScript のみで生成可能なダイアログ
Bootstrap-3-Typeahead3.1.1https://github.com/bassjobsen/Bootstrap-3-Typeahead bootstrap-tagsinput で利用、 typeaheadjs と共存可能

※2 jQuery を必要とするモジュールが 3 系 に対応していないものが多くフロント全般に影響する為、 2 系にした。
※3 Eonasdan-bootstrap-datetimepicker の依存関係として moment.js の webjars がダウンロードされます。(バージョン指定が必要な場合は、個別に定義が必要です。)

ext:

対象内容
ext['thymeleaf.version'] = '3.0.5.RELEASE'Thymeleaf version 3 を利用する設定、Spring Boot 1.4.x.RELEASE のデフォルトは version2 がデフォルト
ext['thymeleaf-layout-dialect.version'] = '2.1.2'Thymeleaf version 3 からは dialect の指定が必要。

etc:

対象バージョン内容または URL
org.springframework.boot:spring-boot-starter-tomcat※1Tomcat ランタイム
webapp-runner8.5.5.0ランチャーアプリケーション Heroku で war を起動させるために利用
com.h2database:h2※1H2 Database ランタイム
org.springframework.boot:spring-boot-starter-test※1SpringBoot test
org.springframework.security:spring-security-test※1SpringBoot Security
org.dbunit:dbunit2.5.3DB Test

SOAP:

対象バージョン内容または URL
org.springframework.boot:spring-boot-starter-web-services※1SpringBoot SOAP
wsdl4j1.6.3WSDL

SOAP client (cURL example):

curl --header "content-type: text/xml" -d @src/test/resources/ws/requestDpt.xml http://localhost:8080/ws/dpt

or (Heroku)

curl --header "content-type: text/xml" -d @src/test/resources/ws/requestDpt.xml http://springboottemplate.herokuapp.com/ws/dpt

REST:

対象バージョン内容または URL
jackson-dataformat-xml2.8.3XML

JSON:

http://localhost:8080/rest/dpt/json/1000
or (Heroku)
http://springboottemplate.herokuapp.com/rest/dpt/json/1000

XML:

http://localhost:8080/rest/dpt/xml/1000
or (Heroku)
http://springboottemplate.herokuapp.com/rest/dpt/xml/1000

CDN

http://www.jsdelivr.com
Thymeleaf の ローカル(AP 経由しない)での表示の際で WebJars と同じバージョンを調査する場合に利用。

動作環境

2016.08.08 現在

  • JDK 8 (8u101)

動作方法

  1. ダウンロード後、解凍し develop-spring-template-master ディレクトリ直下へコンソールで移動。
  2. 「 gradlew 」 を実行( Windows の方は gradlew.bat をダブルクリックでも可)。
  3. ブラウザを立ち上げて 「 http://localhost:8080 」 にアクセス。
    ※終了時は強制終了させてください。

認証情報

ログインIDパスワード
testtestpass

※SpringSecurity のロールはありません。

etc:

Heroku

Heroku

こちらは実験的です、予告なく停止する場合があります。
ローカルで実行しなくてもサンプルが確認できます。

https://springboottemplate.herokuapp.com/
※ Application Error が表示されている場合、 Free dyno の制限になっている可能性があります。
Heroku 無料プラン(Free dyno) を利用しています。
(24 時間の内、6 時間は Sleep 状態にしなければならないという制限があります。)
https://blog.heroku.com/new-dyno-types-public-beta#hobby-and-free-dynos

CI サービス

無料でどこまで利用できるか検証用に利用しています。
(ビルドが目的で Gradle が利用できる前提となります。)
現在検証中は下記サービスです。

Code Coverage

Codacy BadgeCodacy Badge

Codacy の静的解析は Codacy のみで結果を確認できます。
Coverage は Codacy から確認する場合、JaCoCo と JaCoCo のCoverage 結果を送信する仕組みが必要になります(Circle CI からアップロードする仕組みにしています)。

About

SpringBoot template(Spring MVC, Spring Security, WebJars, Thymeleaf, MyBatis)

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Jun 29, 2021. It is now read-only.

Repository files navigation

Spring Boot + Gradle template

Build Statusbuild statuswercker status

Spring Boot , Gradle で開発する際のテンプレートです。

現在提供している機能:

  • SpringSecurity による独自テーブルを利用したログイン処理(パスワードはハッシュ化)。

  • トランザクション管理(システムエラー時ロールバック)

  • 共通のログ出力処理(操作ログ、システムエラーログ、SQL(trace,debug))

  • テストコードサンプル

    • SpringSecurity
    • コントローラに対するテスト
  • コントロールサンプル

    • DateTimePicker : 日付選択(日付のみ、時刻のみ、両方)
    • typeahead : サジェスト機能のようなもの
    • Modal(Bootstrap) ※サブミット非対応
    • bootstrap-dialog : アラート表示
    • bootstrap-switch : スイッチ(トグルスイッチ)
    • bootstrap-tagsinput : タグ入力(typeahead との組み合わせのサンプル)
  • マスタサンプル(ORM:Mybatis)

    • User : バリデーション、カスタムバリデーションサンプル
    • Company : Mybatis XML サンプル
  • etc

    • 入力値検証サンプル : 独自アノテーション(単独、相関チェック)

依存関係

Core(Spring Boot 1.5.3.RELEASE):

対象バージョン内容
org.springframework.boot:spring-boot-starter-data-jpa※1JPA
org.springframework.boot:spring-boot-starter-security※1Spring Security
org.springframework.boot:spring-boot-starter-web※1Spring MVC
org.springframework.boot:spring-boot-starter-thymeleaf※1Template engine
org.springframework.boot:spring-boot-starter-log4j2※1Logging
org.thymeleaf.extras:thymeleaf-extras-springsecurity43.0.1.RELEASETemplate engine Spring Security 拡張
org.thymeleaf.extras:thymeleaf-extras-conditionalcomments※1Template engine IE Conditional comments 拡張
org.mybatis.spring.boot:mybatis-spring-boot-starter1.3.0Spring Boot <-> ORM

※1 Core のバージョンに依存。

Webjars:

http://www.webjars.org/
(※非力な PC だと表示に時間がかかるので注意)

対象バージョン内容または URL
webjars-locator0.32WebJar バージョン番号管理(隠蔽で利用)
jquery2.2.4jQuery 2.2.4 (※2)
bootstrap3.3.7-1Bootstrap 3.3.7
html5shiv3.7.3Bootstrap の IE8 対応用 (HTML5) ※後々削除予定
respond.js1.4.2Bootstrap の IE8 対応用(レスポンシブ) ※後々削除予定
font-awesome4.6.3Font Awesome
Eonasdan-bootstrap-datetimepicker4.17.37-1bootstrap-DateTimePicker(Bootstrap,jQuery, moment.js(※3) 必須)
sticky-footer0.1.4フッター表示
bootswatch3.3.2Bootstrap のテーマ拡張(Lumen を適用) bootswatch 3.3.7 は依存性に問題が発生
typeaheadjs0.11.1https://twitter.github.io/typeahead.js/
hoganjs3.0.2http://twitter.github.io/hogan.js/ typeahead 内部で html テンプレートエンジンとして利用。
bootstrap-dialog1.34.6http://nakupanda.github.io/bootstrap3-dialog/ JavaScript のみで生成可能なダイアログ
Bootstrap-3-Typeahead3.1.1https://github.com/bassjobsen/Bootstrap-3-Typeahead bootstrap-tagsinput で利用、 typeaheadjs と共存可能

※2 jQuery を必要とするモジュールが 3 系 に対応していないものが多くフロント全般に影響する為、 2 系にした。
※3 Eonasdan-bootstrap-datetimepicker の依存関係として moment.js の webjars がダウンロードされます。(バージョン指定が必要な場合は、個別に定義が必要です。)

ext:

対象内容
ext['thymeleaf.version'] = '3.0.5.RELEASE'Thymeleaf version 3 を利用する設定、Spring Boot 1.4.x.RELEASE のデフォルトは version2 がデフォルト
ext['thymeleaf-layout-dialect.version'] = '2.1.2'Thymeleaf version 3 からは dialect の指定が必要。

etc:

対象バージョン内容または URL
org.springframework.boot:spring-boot-starter-tomcat※1Tomcat ランタイム
webapp-runner8.5.5.0ランチャーアプリケーション Heroku で war を起動させるために利用
com.h2database:h2※1H2 Database ランタイム
org.springframework.boot:spring-boot-starter-test※1SpringBoot test
org.springframework.security:spring-security-test※1SpringBoot Security
org.dbunit:dbunit2.5.3DB Test

SOAP:

対象バージョン内容または URL
org.springframework.boot:spring-boot-starter-web-services※1SpringBoot SOAP
wsdl4j1.6.3WSDL

SOAP client (cURL example):

curl --header "content-type: text/xml" -d @src/test/resources/ws/requestDpt.xml http://localhost:8080/ws/dpt

or (Heroku)

curl --header "content-type: text/xml" -d @src/test/resources/ws/requestDpt.xml http://springboottemplate.herokuapp.com/ws/dpt

REST:

対象バージョン内容または URL
jackson-dataformat-xml2.8.3XML

JSON:

http://localhost:8080/rest/dpt/json/1000
or (Heroku)
http://springboottemplate.herokuapp.com/rest/dpt/json/1000

XML:

http://localhost:8080/rest/dpt/xml/1000
or (Heroku)
http://springboottemplate.herokuapp.com/rest/dpt/xml/1000

CDN

http://www.jsdelivr.com
Thymeleaf の ローカル(AP 経由しない)での表示の際で WebJars と同じバージョンを調査する場合に利用。

動作環境

2016.08.08 現在

  • JDK 8 (8u101)

動作方法

  1. ダウンロード後、解凍し develop-spring-template-master ディレクトリ直下へコンソールで移動。
  2. 「 gradlew 」 を実行( Windows の方は gradlew.bat をダブルクリックでも可)。
  3. ブラウザを立ち上げて 「 http://localhost:8080 」 にアクセス。
    ※終了時は強制終了させてください。

認証情報

ログインIDパスワード
testtestpass

※SpringSecurity のロールはありません。

etc:

Heroku

Heroku

こちらは実験的です、予告なく停止する場合があります。
ローカルで実行しなくてもサンプルが確認できます。

https://springboottemplate.herokuapp.com/
※ Application Error が表示されている場合、 Free dyno の制限になっている可能性があります。
Heroku 無料プラン(Free dyno) を利用しています。
(24 時間の内、6 時間は Sleep 状態にしなければならないという制限があります。)
https://blog.heroku.com/new-dyno-types-public-beta#hobby-and-free-dynos

CI サービス

無料でどこまで利用できるか検証用に利用しています。
(ビルドが目的で Gradle が利用できる前提となります。)
現在検証中は下記サービスです。

Code Coverage

Codacy BadgeCodacy Badge

Codacy の静的解析は Codacy のみで結果を確認できます。
Coverage は Codacy から確認する場合、JaCoCo と JaCoCo のCoverage 結果を送信する仕組みが必要になります(Circle CI からアップロードする仕組みにしています)。

About

SpringBoot template(Spring MVC, Spring Security, WebJars, Thymeleaf, MyBatis)

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Jun 29, 2021. It is now read-only.

Repository files navigation

Spring Boot + Gradle template

Build Statusbuild statuswercker status

Spring Boot , Gradle で開発する際のテンプレートです。

現在提供している機能:

  • SpringSecurity による独自テーブルを利用したログイン処理(パスワードはハッシュ化)。

  • トランザクション管理(システムエラー時ロールバック)

  • 共通のログ出力処理(操作ログ、システムエラーログ、SQL(trace,debug))

  • テストコードサンプル

    • SpringSecurity
    • コントローラに対するテスト
  • コントロールサンプル

    • DateTimePicker : 日付選択(日付のみ、時刻のみ、両方)
    • typeahead : サジェスト機能のようなもの
    • Modal(Bootstrap) ※サブミット非対応
    • bootstrap-dialog : アラート表示
    • bootstrap-switch : スイッチ(トグルスイッチ)
    • bootstrap-tagsinput : タグ入力(typeahead との組み合わせのサンプル)
  • マスタサンプル(ORM:Mybatis)

    • User : バリデーション、カスタムバリデーションサンプル
    • Company : Mybatis XML サンプル
  • etc

    • 入力値検証サンプル : 独自アノテーション(単独、相関チェック)

依存関係

Core(Spring Boot 1.5.3.RELEASE):

対象バージョン内容
org.springframework.boot:spring-boot-starter-data-jpa※1JPA
org.springframework.boot:spring-boot-starter-security※1Spring Security
org.springframework.boot:spring-boot-starter-web※1Spring MVC
org.springframework.boot:spring-boot-starter-thymeleaf※1Template engine
org.springframework.boot:spring-boot-starter-log4j2※1Logging
org.thymeleaf.extras:thymeleaf-extras-springsecurity43.0.1.RELEASETemplate engine Spring Security 拡張
org.thymeleaf.extras:thymeleaf-extras-conditionalcomments※1Template engine IE Conditional comments 拡張
org.mybatis.spring.boot:mybatis-spring-boot-starter1.3.0Spring Boot <-> ORM

※1 Core のバージョンに依存。

Webjars:

http://www.webjars.org/
(※非力な PC だと表示に時間がかかるので注意)

対象バージョン内容または URL
webjars-locator0.32WebJar バージョン番号管理(隠蔽で利用)
jquery2.2.4jQuery 2.2.4 (※2)
bootstrap3.3.7-1Bootstrap 3.3.7
html5shiv3.7.3Bootstrap の IE8 対応用 (HTML5) ※後々削除予定
respond.js1.4.2Bootstrap の IE8 対応用(レスポンシブ) ※後々削除予定
font-awesome4.6.3Font Awesome
Eonasdan-bootstrap-datetimepicker4.17.37-1bootstrap-DateTimePicker(Bootstrap,jQuery, moment.js(※3) 必須)
sticky-footer0.1.4フッター表示
bootswatch3.3.2Bootstrap のテーマ拡張(Lumen を適用) bootswatch 3.3.7 は依存性に問題が発生
typeaheadjs0.11.1https://twitter.github.io/typeahead.js/
hoganjs3.0.2http://twitter.github.io/hogan.js/ typeahead 内部で html テンプレートエンジンとして利用。
bootstrap-dialog1.34.6http://nakupanda.github.io/bootstrap3-dialog/ JavaScript のみで生成可能なダイアログ
Bootstrap-3-Typeahead3.1.1https://github.com/bassjobsen/Bootstrap-3-Typeahead bootstrap-tagsinput で利用、 typeaheadjs と共存可能

※2 jQuery を必要とするモジュールが 3 系 に対応していないものが多くフロント全般に影響する為、 2 系にした。
※3 Eonasdan-bootstrap-datetimepicker の依存関係として moment.js の webjars がダウンロードされます。(バージョン指定が必要な場合は、個別に定義が必要です。)

ext:

対象内容
ext['thymeleaf.version'] = '3.0.5.RELEASE'Thymeleaf version 3 を利用する設定、Spring Boot 1.4.x.RELEASE のデフォルトは version2 がデフォルト
ext['thymeleaf-layout-dialect.version'] = '2.1.2'Thymeleaf version 3 からは dialect の指定が必要。

etc:

対象バージョン内容または URL
org.springframework.boot:spring-boot-starter-tomcat※1Tomcat ランタイム
webapp-runner8.5.5.0ランチャーアプリケーション Heroku で war を起動させるために利用
com.h2database:h2※1H2 Database ランタイム
org.springframework.boot:spring-boot-starter-test※1SpringBoot test
org.springframework.security:spring-security-test※1SpringBoot Security
org.dbunit:dbunit2.5.3DB Test

SOAP:

対象バージョン内容または URL
org.springframework.boot:spring-boot-starter-web-services※1SpringBoot SOAP
wsdl4j1.6.3WSDL

SOAP client (cURL example):

curl --header "content-type: text/xml" -d @src/test/resources/ws/requestDpt.xml http://localhost:8080/ws/dpt

or (Heroku)

curl --header "content-type: text/xml" -d @src/test/resources/ws/requestDpt.xml http://springboottemplate.herokuapp.com/ws/dpt

REST:

対象バージョン内容または URL
jackson-dataformat-xml2.8.3XML

JSON:

http://localhost:8080/rest/dpt/json/1000
or (Heroku)
http://springboottemplate.herokuapp.com/rest/dpt/json/1000

XML:

http://localhost:8080/rest/dpt/xml/1000
or (Heroku)
http://springboottemplate.herokuapp.com/rest/dpt/xml/1000

CDN

http://www.jsdelivr.com
Thymeleaf の ローカル(AP 経由しない)での表示の際で WebJars と同じバージョンを調査する場合に利用。

動作環境

2016.08.08 現在

  • JDK 8 (8u101)

動作方法

  1. ダウンロード後、解凍し develop-spring-template-master ディレクトリ直下へコンソールで移動。
  2. 「 gradlew 」 を実行( Windows の方は gradlew.bat をダブルクリックでも可)。
  3. ブラウザを立ち上げて 「 http://localhost:8080 」 にアクセス。
    ※終了時は強制終了させてください。

認証情報

ログインIDパスワード
testtestpass

※SpringSecurity のロールはありません。

etc:

Heroku

Heroku

こちらは実験的です、予告なく停止する場合があります。
ローカルで実行しなくてもサンプルが確認できます。

https://springboottemplate.herokuapp.com/
※ Application Error が表示されている場合、 Free dyno の制限になっている可能性があります。
Heroku 無料プラン(Free dyno) を利用しています。
(24 時間の内、6 時間は Sleep 状態にしなければならないという制限があります。)
https://blog.heroku.com/new-dyno-types-public-beta#hobby-and-free-dynos

CI サービス

無料でどこまで利用できるか検証用に利用しています。
(ビルドが目的で Gradle が利用できる前提となります。)
現在検証中は下記サービスです。

Code Coverage

Codacy BadgeCodacy Badge

Codacy の静的解析は Codacy のみで結果を確認できます。
Coverage は Codacy から確認する場合、JaCoCo と JaCoCo のCoverage 結果を送信する仕組みが必要になります(Circle CI からアップロードする仕組みにしています)。

About

SpringBoot template(Spring MVC, Spring Security, WebJars, Thymeleaf, MyBatis)

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
This repository was archived by the owner on Jun 29, 2021. It is now read-only.

Repository files navigation

Spring Boot + Gradle template

Build Statusbuild statuswercker status

Spring Boot , Gradle で開発する際のテンプレートです。

現在提供している機能:

  • SpringSecurity による独自テーブルを利用したログイン処理(パスワードはハッシュ化)。

  • トランザクション管理(システムエラー時ロールバック)

  • 共通のログ出力処理(操作ログ、システムエラーログ、SQL(trace,debug))

  • テストコードサンプル

    • SpringSecurity
    • コントローラに対するテスト
  • コントロールサンプル

    • DateTimePicker : 日付選択(日付のみ、時刻のみ、両方)
    • typeahead : サジェスト機能のようなもの
    • Modal(Bootstrap) ※サブミット非対応
    • bootstrap-dialog : アラート表示
    • bootstrap-switch : スイッチ(トグルスイッチ)
    • bootstrap-tagsinput : タグ入力(typeahead との組み合わせのサンプル)
  • マスタサンプル(ORM:Mybatis)

    • User : バリデーション、カスタムバリデーションサンプル
    • Company : Mybatis XML サンプル
  • etc

    • 入力値検証サンプル : 独自アノテーション(単独、相関チェック)

依存関係

Core(Spring Boot 1.5.3.RELEASE):

対象バージョン内容
org.springframework.boot:spring-boot-starter-data-jpa※1JPA
org.springframework.boot:spring-boot-starter-security※1Spring Security
org.springframework.boot:spring-boot-starter-web※1Spring MVC
org.springframework.boot:spring-boot-starter-thymeleaf※1Template engine
org.springframework.boot:spring-boot-starter-log4j2※1Logging
org.thymeleaf.extras:thymeleaf-extras-springsecurity43.0.1.RELEASETemplate engine Spring Security 拡張
org.thymeleaf.extras:thymeleaf-extras-conditionalcomments※1Template engine IE Conditional comments 拡張
org.mybatis.spring.boot:mybatis-spring-boot-starter1.3.0Spring Boot <-> ORM

※1 Core のバージョンに依存。

Webjars:

http://www.webjars.org/
(※非力な PC だと表示に時間がかかるので注意)

対象バージョン内容または URL
webjars-locator0.32WebJar バージョン番号管理(隠蔽で利用)
jquery2.2.4jQuery 2.2.4 (※2)
bootstrap3.3.7-1Bootstrap 3.3.7
html5shiv3.7.3Bootstrap の IE8 対応用 (HTML5) ※後々削除予定
respond.js1.4.2Bootstrap の IE8 対応用(レスポンシブ) ※後々削除予定
font-awesome4.6.3Font Awesome
Eonasdan-bootstrap-datetimepicker4.17.37-1bootstrap-DateTimePicker(Bootstrap,jQuery, moment.js(※3) 必須)
sticky-footer0.1.4フッター表示
bootswatch3.3.2Bootstrap のテーマ拡張(Lumen を適用) bootswatch 3.3.7 は依存性に問題が発生
typeaheadjs0.11.1https://twitter.github.io/typeahead.js/
hoganjs3.0.2http://twitter.github.io/hogan.js/ typeahead 内部で html テンプレートエンジンとして利用。
bootstrap-dialog1.34.6http://nakupanda.github.io/bootstrap3-dialog/ JavaScript のみで生成可能なダイアログ
Bootstrap-3-Typeahead3.1.1https://github.com/bassjobsen/Bootstrap-3-Typeahead bootstrap-tagsinput で利用、 typeaheadjs と共存可能

※2 jQuery を必要とするモジュールが 3 系 に対応していないものが多くフロント全般に影響する為、 2 系にした。
※3 Eonasdan-bootstrap-datetimepicker の依存関係として moment.js の webjars がダウンロードされます。(バージョン指定が必要な場合は、個別に定義が必要です。)

ext:

対象内容
ext['thymeleaf.version'] = '3.0.5.RELEASE'Thymeleaf version 3 を利用する設定、Spring Boot 1.4.x.RELEASE のデフォルトは version2 がデフォルト
ext['thymeleaf-layout-dialect.version'] = '2.1.2'Thymeleaf version 3 からは dialect の指定が必要。

etc:

対象バージョン内容または URL
org.springframework.boot:spring-boot-starter-tomcat※1Tomcat ランタイム
webapp-runner8.5.5.0ランチャーアプリケーション Heroku で war を起動させるために利用
com.h2database:h2※1H2 Database ランタイム
org.springframework.boot:spring-boot-starter-test※1SpringBoot test
org.springframework.security:spring-security-test※1SpringBoot Security
org.dbunit:dbunit2.5.3DB Test

SOAP:

対象バージョン内容または URL
org.springframework.boot:spring-boot-starter-web-services※1SpringBoot SOAP
wsdl4j1.6.3WSDL

SOAP client (cURL example):

curl --header "content-type: text/xml" -d @src/test/resources/ws/requestDpt.xml http://localhost:8080/ws/dpt

or (Heroku)

curl --header "content-type: text/xml" -d @src/test/resources/ws/requestDpt.xml http://springboottemplate.herokuapp.com/ws/dpt

REST:

対象バージョン内容または URL
jackson-dataformat-xml2.8.3XML

JSON:

http://localhost:8080/rest/dpt/json/1000
or (Heroku)
http://springboottemplate.herokuapp.com/rest/dpt/json/1000

XML:

http://localhost:8080/rest/dpt/xml/1000
or (Heroku)
http://springboottemplate.herokuapp.com/rest/dpt/xml/1000

CDN

http://www.jsdelivr.com
Thymeleaf の ローカル(AP 経由しない)での表示の際で WebJars と同じバージョンを調査する場合に利用。

動作環境

2016.08.08 現在

  • JDK 8 (8u101)

動作方法

  1. ダウンロード後、解凍し develop-spring-template-master ディレクトリ直下へコンソールで移動。
  2. 「 gradlew 」 を実行( Windows の方は gradlew.bat をダブルクリックでも可)。
  3. ブラウザを立ち上げて 「 http://localhost:8080 」 にアクセス。
    ※終了時は強制終了させてください。

認証情報

ログインIDパスワード
testtestpass

※SpringSecurity のロールはありません。

etc:

Heroku

Heroku

こちらは実験的です、予告なく停止する場合があります。
ローカルで実行しなくてもサンプルが確認できます。

https://springboottemplate.herokuapp.com/
※ Application Error が表示されている場合、 Free dyno の制限になっている可能性があります。
Heroku 無料プラン(Free dyno) を利用しています。
(24 時間の内、6 時間は Sleep 状態にしなければならないという制限があります。)
https://blog.heroku.com/new-dyno-types-public-beta#hobby-and-free-dynos

CI サービス

無料でどこまで利用できるか検証用に利用しています。
(ビルドが目的で Gradle が利用できる前提となります。)
現在検証中は下記サービスです。

Code Coverage

Codacy BadgeCodacy Badge

Codacy の静的解析は Codacy のみで結果を確認できます。
Coverage は Codacy から確認する場合、JaCoCo と JaCoCo のCoverage 結果を送信する仕組みが必要になります(Circle CI からアップロードする仕組みにしています)。

About

SpringBoot template(Spring MVC, Spring Security, WebJars, Thymeleaf, MyBatis)

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages