JHipsterで学ぶ!Springによるサーバサイド開発手法

 JHipsterで学ぶ!Springによるサーバサイド開発手法

JHipsterで学ぶ!Springによるサーバサイド開発手法
JJUG CCC 2017 Spring
#ccc_f1

87e94dd0e8a5f52de58a0e4a0b1a1f3f?s=128

Shinichi Kozake

May 19, 2017
Tweet

Transcript

  1. +)JQTUFSͰ ֶͿʂ 4QSJOHʹΑΔαʔόαΠυ։ൃख๏ ++6($$$4QSJOH DDD@G

  2. 4ZTUFN"SDIJUFDU 4ZTUFN"SDIJUFDU +BWB ͚͜͟ 8IPBN*

  3. ࠂ஌ʂʂ

  4. ,"/+"7"1"35: େࡕ ೔ຊϚΠΫϩιϑτؔ੢ࢧࣾ

  5. ࠓ೔ͷΰʔϧ https://flic.kr/p/23R1Tx

  6. +)JQTUFSͱ͸ https://flic.kr/p/4ms8ZA

  7. 8IZ+)JQTUFS https://flic.kr/p/dGrMZz

  8. -FBSO4QSJOH XJUI+)JQTUFS https://flic.kr/p/qex9y4

  9. (SFBU4QSJOH 'VO+)JQTUFS ʘ͢͝ʔ͍ʂͨͷ͠ʔʂʗ

  10. ஫ҙࣄ߲ʂ https://flic.kr/p/qSmXKV

  11. ͜ͷΑ͏ͳ΋ͷ͸͍͟͝·ͥΜɻɻɻ ؗد؄װ؝د؆

  12. ࠓ೔ͷର৅ऀ 4QSJOH͸Ұ௨Γษڧͨ͠ʂ ޮ཰తͳ։ൃख๏Λ୳ٻத ໌೔ʹͰ΋αʔϏεΛ্ཱ͍ͪ͛ͨʂ https://flic.kr/p/oowrrL ͰɺͲ͏։ൃ͢Ε͹ʁ

  13. "HFOEB (FUUJOH4UBSU +)JQTUFSͱ͸ -FBSOXJUI+)JQTUFS ·ͱΊ

  14. "HFOEB (FUUJOH4UBSU +)JQTUFSͱ͸ -FBSOXJUI+)JQTUFS ·ͱΊ

  15.  +)JQTUFSJTB:FPNBOHFOFSBUPS 4QSJOH#PPU "OHVMBS Ϟμϯ8FCΞϓϦέʔγϣϯΛૉૣ͘࡞ΕΔ͜ͱΛ໨త Φʔϓϯιʔε :FPNBO͸Ϟμϯ8FCΞϓϦέʔγϣϯΛఏڙ͢Δ4DB⒎PMEπʔϧ ͢΂ͯ(JU)VCͰ։ൃɻ"QBDIFMJDFOTFEɻ ਓͷ։ൃऀͱਓͷίϯτϦϏϡʔλ IUUQTHJUIVCDPNKIJQTUFSHFOFSBUPSKIJQTUFS

    +)JQTUFSJT
  16.  4DB⒎PME5PPMJT ʮTDB⒎PMEʢεΩϟϑΥʔϧυʣʯ͸ʮ଍৔ʯͱ͍͏ҙຯͰ͢ɻ ʮ଍৔ʯͱ͍͏໊ͷ௨ΓɺΞϓϦέʔγϣϯͷͻͳܗͱͳΔ ιʔείʔυΛࣗಈੜ੒͠·͢ɻ

  17.  )JTUPSZ ೥݄ʹ+VMJFO%VCPJTʹΑͬͯ։࢝͞Ε·ͨ͠ɻ ࠷ॳͷެࣜϦϦʔε WFSTJPO ͕೥݄೔ɻ ͦΕҎདྷɺ΋ͷϦϦʔε͕͞Ε͍ͯ·͢ʂʢݱࡏʣ

  18. 8IZ+)JQTUFS https://flic.kr/p/dGrMZz

  19.  #PIWNCT 5RTKPI$QQV 4QSJOH#PPUͱ"OHVMBS͸ɺ ૉ੖Β͍͠ϑϧελοΫϑϨʔϜϫʔΫͰ͢ɻ

  20.  #PIWNCT Ͱ͕͢ɺͱͯ΋େ͖ͳϑϨʔϜϫʔΫͰ͢ɻ शಘίετ΋େ͖͍Ͱ͢ɻ 5RTKPI$QQV

  21.  +)JQTUFSΛ༻͍Δ͜ͱͰ ͢͹΍͘8FCΞϓϦέʔγϣϯͷ ਽ܗΛ࡞Δ͜ͱ͕Ͱ͖·͢ʂ ૉ੖Β͍͠αϯϓϧ͸ϓϩδΣΫτʹͱͬͯඇৗʹ༗ޮͰ͢ɻ

  22.  ͜Ε͕+)JQTUFSͰੜ੒͞Εͨ8FCΞϓϦέʔγϣϯͷը໘Ͱ͢ɻ

  23.  ೝূ΍ೝՄͷ࢓૊Έ͕࠷ॳ͔Β༻ҙ͞Ε͍ͯ·͢ɻ ΦϓγϣϯʹΑΓ4PDJBMϩάΠϯ΋༻ҙ͞Ε·͢ɻ

  24.  JO *OUFSOBUJPOBMJ[BUJPO ΋༻ҙ͞Ε͓ͯΓɺ ݴޠλϒʹΑΓදࣔݴޠΛ੾Γସ͑Δ͜ͱ͕ՄೳͰ͢ɻ

  25.  ΞϓϦέʔγϣϯΛ؅ཧ͢Δҝͷ༷ʑͳػೳ͕༻ҙ͞Ε͍ͯ·͢ɻ ྫ͑͹؅ཧϝτϦΫεΛબ୒͢Δͱɺ+7.ͷঢ়ଶ΍ )551ϦΫΤετ਺ͳͲΛ֬ೝ͢Δ͜ͱ͕Ͱ͖·͢ɻ

  26.  ؅ཧϔϧενΣοΫΛબ୒͢Δͱɺ σʔλϕʔε΍σΟεΫεϖʔεͷঢ়ଶΛ֬ೝ͢Δ͜ͱ͕Ͱ͖·͢ɻ

  27.  ؅ཧઃఆΛબ୒͢Δͱɺ 4QSJOHDPOpHVSBUJPO΍TZTUFN&OWJSPONFOUͳͲɺ ֤छΞϓϦέʔγϣϯ؀ڥઃఆΛදࣔͰ͖·͢ɻ

  28.  ؅ཧϩάΛબ୒͢Δͱɺϩάઃఆͷ֬ೝ΍มߋ͕Ͱ͖·͢ɻ

  29.  ؅ཧ"1*Λબ୒͢Δͱɺ4XBHHFS6*ʹΑΔ8FC"1*ͷυΩϡϝϯτ ΛදࣔͰ͖·͢ɻ

  30.  ։ൃϞʔυͰىಈͨ͠৔߹͸ɺ؅ཧσʔλϕʔε͕બ୒Ͱ͖·͢ɻ ͜ΕΛબ୒͢Δͱɺ઀ଓ͍ͯ͠Δσʔλϕʔεͷ؅ཧը໘ΛදࣔͰ͖·͢ɻ

  31.  σʔλϕʔεʹϩάΠϯ͢Δ͜ͱͰɺσʔλϕʔεͷ಺༰Λ֬ೝͰ͖·͢ɻ

  32.  શ͕ͯ࠷ॳ͔Β8FC"QQMJDBUJPOʹ༻ҙʂʂ

  33.  +)JQTUFSͰѹ౗త੒ޭʂ

  34. "HFOEB (FUUJOH4UBSU +)JQTUFSͱ͸ -FBSOXJUI+)JQTUFS ·ͱΊ

  35. )PXUPJOTUBMM

  36.  ϩʔΧϧΠϯετʔϧ 7BHSBOUͰͷΠϯετʔϧ %PDLFSͰͷΠϯετʔϧ +)JQTUFS͸ϩʔΧϧΠϯετʔϧͷଞɺ7BHSBOU΍%PDLFSΛ࢖ͬͨ Πϯετʔϧ͕ՄೳͰ͢

  37.  ϩʔΧϧΠϯετʔϧ 7BHSBOUͰͷΠϯετʔϧ %PDLFSͰͷΠϯετʔϧ ࠓճ͸ɺϩʔΧϧΠϯετʔϧΛ঺հ͠·͢

  38.  +BWBΛ0SBDMFͷ8FCαΠτ͔ΒΠϯετʔϧ Ϗϧυπʔϧ͸.BWFO͔(SBEMFΛબ୒Մೳ ˞͜ΕΒ͸8SBQQFSͰࣗಈతʹΠϯετʔϧ͞ΕΔͷͰɺ༻ҙ͠ͳͯ͘΋0, HJUTDNDPN͔Β(JUΛΠϯετʔϧ /PEFKTͷ8FCαΠτ͔Β/PEFKTΛΠϯετʔϧ ҰॹʹΠϯετʔϧ͞ΕΔOQNΛ࢖༻ͯ͠ +)JQTUFSʹඞཁͳOQNύοέʔδΛΠϯετʔϧ

  39.  OQNJOTUBMMHZP OQNJOTUBMMHCPXFS OQNJOTUBMMHHVMQDMJ OQNJOTUBMMHHFOFSBUPSKIJQTUFS :FPNBOͷΠϯετʔϧ #PXFSͷΠϯετʔϧ (VMQͷΠϯετʔϧ +)JQTUFSͷΠϯετʔϧ ^

    0OMZGPS "OHVMBS+4
  40. )PXUPDSFBUFBQQ

  41.  ্هίϚϯυΛ࣮ߦ͢Δͱɺ+)JQTUFSͷΞϓϦέʔγϣϯ࡞੒͕࢝·Γ·͢ɻ NLEJSKKVH@DDD DEKKVH@DDD ZPKIJQTUFS

  42.  +)JQTUFSͰ͸.POPMJUIJDͳΞϓϦέʔγϣϯ ΋͘͠͸ɺϚΠΫϩαʔϏεΞϓϦέʔγϣϯΛબ୒Ͱ͖·͢ɻ ██╗ ██╗ ██╗ ████████╗ ███████╗ ██████╗ ████████╗

    ████████╗ ███████╗ ██║ ██║ ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗ ██║ ████████║ ██║ ███████╔╝ ╚█████╗ ██║ ██████╗ ███████╔╝ ██╗ ██║ ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║ ╚██████╔╝ ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗ ╚═════╝ ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝ https://jhipster.github.io Welcome to the JHipster Generator v4.4.1 Documentation for creating an application: https://jhipster.github.io/creating-an-app/ Application files will be generated in folder: /Users/s_kozake/develop/jhipsterApp/hogeHipster ? (1/16) Which *type* of application would you like to create? (Use arrow keys) ❯ Monolithic application (recommended for simple projects) Microservice application Microservice gateway [BETA] JHipster UAA server (for microservice OAuth2 authentication)
  43.  +)JQTUFSΛ༻͍Δͱɺ্هྫͷΑ͏ͳϚΠΫϩαʔϏεΞϓϦέʔγϣϯߏ੒΋ खܰʹߏஙͰ͖·͢ɻ

  44.  ্هͷ੺࿮͕KIJQTUFSHFOFSBUPSͰ࡞੒ՄೳͰ͢ɻ

  45.  ͍͔ͭ͘ͷ࣭໰ʹ౴͑Δͱ ύοέʔδ໊͸ʁ σʔλϕʔε͸ʁ ϓϩμΫτ͸ʁ ΞϓϦ໊͸ʁ ։ൃ͸ʁ .BWFO PS (SBEMF

    ೝূํࣜ͸ʁ "OHVMBS+4 PS "OHVMBS FUDFUD
  46.  Server application generated successfully. Client application generated successfully. ϓϩδΣΫτͷ४උ͕Ͱ͖·ͨ͠ʂ

  47. )PXUPSVO

  48.  Ϗϧυπʔϧʹ(SBEMFΛબ୒ͨ͠৔߹ɺ্هίϚϯυΛ࣮ߦ͢Δͱɺ ϙʔτͰ8FCΞϓϦέʔγϣϯ͕ىಈ͠·͢ɻ ϏϧτΠϯ5PNDBU͕ىಈ͠·͢ʂ HSBEMFXCPPUSVO

  49.  ϒϥ΢βͰMPDBMIPTUͷϙʔτʹ઀ଓ͢Δͱɺ ը໘͕දࣔ͞Ε·͢ɻ

  50.  ΞΧ΢ϯτೝূΛબ୒ͯ͠ϩάΠϯ͠·͢ɻ BENJOͱVTFSͷΞΧ΢ϯτ͕σϑΥϧτͰ༻ҙ͞Ε͍ͯ·͢ɻ ॳظύεϫʔυ͸ΞΧ΢ϯτ໊ͱಉ͡Ͱ͢ɻ

  51.  BENJOΞΧ΢ϯτͰϩάΠϯ͢ΔͱɺΤϯςΟςΟ΍؅ཧ͕ φϏήʔγϣϯλϒʹදࣔ͞Ε·͢ɻ

  52. $SFBUFFOUJUZ

  53.  +)JQTUFSͷΤϯςΟςΟαϒδΣωϨʔλΛ༻͍ͯɺ ্ͷΑ͏ͳ&OUJUZͱͦΕΛฤू͢Δ$36%ը໘Λੜ੒͠·͢ɻ

  54.  ZPKIJQTUFSFOUJUZBVUIPS ্هίϚϯυΛ࣮ߦͯ͠ɺ"VUIPS&OUJUZΛੜ੒͠·͢ɻ

  55.  ͍͔ͭ͘ͷ࣭໰ʹ౴͑Δͱ ϑΟʔϧυͷܕ͸ʁ %50͸ ผʹͭ͘Δʁ ϑΟʔϧυ໊͸ʁ ϦϨʔγϣϯ͸ʁ όϦσʔγϣϯ ํ๏͸ʁ αʔϏεͷ

    ࡞Γํ͸ʁ FUDFUD
  56.  Everything is configured, generating the entity... ΤϯςΟςΟ͕࡞੒͞Ε·͢ʂ

  57.  ಉ༷ʹɺ#PPL&OUJUZΛੜ੒͠·͢ɻ ZPKIJQTUFSFOUJUZCPPL

  58.  ϩάΠϯ͢ΔͱɺΤϯςΟςΟʹ"VUIPSͱ#PPL͕௥Ճ͞Ε͍ͯ·͢ɻ

  59.  ΤϯςΟςΟ#PPLΛબ୒͢Δͱɺ$36%ը໘͕දࣔͰ͖·͢ɻ

  60.  ΤϯςΟςΟ#PPLͷදࣔը໘ɻ

  61.  ΤϯςΟςΟ#PPLͷฤूը໘ɻ

  62.  ΤϯςΟςΟ#PPLͷ࡟আ֬ೝμΠΞϩάɻ

  63.  ΤϯςΟςΟαϒδΣωϨʔλͷ୅ΘΓʹɺ+%-4UVEJPΛ༻͍Δ͜ͱ΋ग़དྷ·͢ɻ +%-4UVEJP͸ϒϥ΢βϕʔεͷ(6*πʔϧͰ͢ɻ +)JQTUFS%PNBJO-BOHVBHF +%- Λ༻͍ͯɺΤϯςΟςΟઃܭ͕Ͱ͖·͢ɻ

  64.  ZPKIJQTUFSJNQPSUKEMdKIJQTUFSKEMKI +%-4UVEJPͰ࡞੒ͨ͠ϑΝΠϧΛɺ্هίϚϯυͰಡΈࠐΉ͜ͱͰ ಉ༷ͷ͜ͱ͕Ͱ͖·͢ʂ

  65. "HFOEB (FUUJOH4UBSU +)JQTUFSͱ͸ -FBSOXJUI+)JQTUFS ·ͱΊ

  66.  ? ? αʔόαΠυ։ൃͱͻͱ͜ͱͰݴͬͯ΋ɺߟ͑Δ͜ͱ͸ͨ͘͞Μ͋Γ·͢ɻ ͍͟։ൃ͢ΔͱͳΔͱɺʮ͜Ε͸Ͳ͏͢Ε͹ʁʯͱ໎͏͜ͱ΋ଟ͍Ͱ͢ɻ ϩάग़ྗ ೝূ ؂ࠪূ੻ 3&45GVM"1* Τϥʔॲཧ

    ϖʔδϯά ޮ཰ྑ͍։ൃ ӡ༻ ηΩϡϦςΟ ΞϓϦߏ੒
  67.  ͦ͜Ͱɺ+)JQTUFS͕ग़ྗ͢ΔιʔείʔυΛࢀߟʹͯ͠Έͯ͸೗ԿͰ͠ΐ͏ʂ ચ࿅͞Ε࣮ͨ૷ͷώϯτ͕ࢄΒ͹͍ͬͯΔͱࢥ͍·͢ʂ ϩάग़ྗ ೝূ ؂ࠪূ੻ 3&45GVM"1* Τϥʔॲཧ ϖʔδϯά ޮ཰ྑ͍։ൃ

    ӡ༻ ηΩϡϦςΟ ΞϓϦߏ੒ !
  68. +)JQTUFSͰ ֶͿʂ 4QSJOHʹΑΔαʔόαΠυ։ൃख๏

  69. +)JQTUFSͰ ֶͿʂ 4QSJOH։ൃͷϕετϓϥΫςΟε ͔ͯύΫΔ ΅ͦ

  70.  ? ? ΞϓϦέʔγϣϯߏ੒ͬͯͲ͏͢Ε͹͍͍Ͱ͠ΐ͏͔ʁ ύοέʔδߏ੒ؚΊͯ໎͏͜ͱଟ͍Ͱ͢ΑͶɻ ϩάग़ྗ ೝূ ؂ࠪূ੻ 3&45GVM"1* Τϥʔॲཧ

    ϖʔδϯά ޮ཰ྑ͍։ൃ ӡ༻ ηΩϡϦςΟ ΞϓϦߏ੒
  71.  ΞϓϦέʔγϣϯߏ੒ 9GD 鱙鯮鱷鱝 鱭鲅鱈鲗 鲎鲁鱜鱬鲎 *QIG 4GUQWTEG *QIG 5GTXKEG

    *QIG&61 *QIG 4GRQUKVQT[ *QIG 鱟鱑鲉鲎鱪鱇崎⹻#12 .QIIKPI #URGEV 5GEWTKV[ %QPHKIWTCVKQP &QOCKP7UGT &GVCKN5GTXKEG
  72.  [packageName] │ ├── aop - AOP関連 ├── config -

    JavaConfig関連 ├── domain - ドメイン層のBean定義 ├── repository - リポジトリ層のBean定義 ├── security - セキュリティ関連 ├── service - サービス層のBean定義 └── web - プレゼンテーション層 └── rest - Spring MVC RESTコントローラの定義 ύοέʔδߏ੒ ύοέʔδߏ੒΋ΞϓϦέʔγϣϯߏ੒ʹԊͬͨ΋ͷͱͳ͍ͬͯΔͨΊɺ Ͳ͜ʹԿ͕͋Δͷ͔͕େมΘ͔Γ΍͍͢Ͱ͢ɻ
  73.  ϩάग़ྗ͸Ͳ͏͢Ε͹͍͍ͷͰ͠ΐ͏Ͷʁ $PNNPOT-PHHJOH -PH+ -PHCBDL 4-'+ +6- -PH4UBTIͱͷ࿈ܞ  +BWBϓϥοτϑΥʔϜͰͷϩάग़ྗ͸ɺ৭ʑͱબ୒ࢶ͕͋Γ͗ͯ͢೰Έ·͢ɻ

    ? ? ೝূ ؂ࠪূ੻ 3&45GVM"1* Τϥʔॲཧ ϖʔδϯά ޮ཰ྑ͍։ൃ ӡ༻ ηΩϡϦςΟ ΞϓϦߏ੒ ϩάग़ྗ
  74.  dependencies {
 :
 compile "org.springframework.boot:spring-boot-starter-logging" :
 } CVJMEHSBEMF 4QSJOH#PPUʹ͸$PNNPOT-PHHJOH"1*Λআ͍ͯඞਢͷϩΪϯάґଘؔ܎͸͋Γ·ͤΜɻ

    ྫ͑͹-PHCBDLΛ࢖༻͢Δ৔߹ɺຊདྷ͸༷ʑͳઃఆΛ௥Ճ͢Δඞཁ͕͋Γ·͢ɻ ʮTQSJOHCPPUTUBSUFSMPHHJOHʯΛґଘʹ૊ΈࠐΉ͜ͱͰɺΫϥεύεʹج͍ͮͯ ϩΪϯάΛઃఆΛͯ͘͠Ε·͢ɻ -PHCBDL͕༗ޮͳΒ͹ͦΕ͕࠷ॳʹ࠾༻͞Ε·͢ɻ +)JQTUFSͰ΋ɺʮTQSJOHCPPUTUBSUFSMPHHJOHʯΛґଘʹ૊ΈࠐΜͰ͍·͢ɻ ϩάग़ྗ
  75.  ϩάग़ྗ ΫϥεύεͷϧʔτʹMPHCBDLTQSJOHYNM͕͋Ε͹ɺͦͷઃఆ͕࠾༻͞Ε·͢ɻ 4QSJOH#PPU͸JODMVEFՄೳͳσϑΥϧτઃఆΛఏڙ͍ͯ͠·͢ɻ ͜ͷઃఆΛมߋ͢Δ͜ͱͰɺϩάϨϕϧͳͲͷมߋ΍৽ͨͳ௥Ճ͕ՄೳͰ͢ɻ <?xml version="1.0" encoding="UTF-8"?>
 
 <configuration

    scan="true">
 <include resource="org/springframework/boot/logging/logback/base.xml"/>
 :
 <logger name="com.mycompany.myapp" level="#logback.loglevel#"/>
 <logger name="io.github.jhipster" level="DEBUG"/>
 <logger name="javax.activation" level="WARN"/>
 :
 <root level="#logback.loglevel#">
 <appender-ref ref="CONSOLE"/>
 </root>
 </configuration>
 SFTPVSDFTMPHCBDLTQSJOHYNM σϑΥϧτઃఆ
  76.  ϩάग़ྗ @Pointcut("within(jjug_ccc.repository..*) "
 + "|| within(jjug_ccc.service..*) "
 + "||

    within(jjug_ccc.web.rest..*)")
 public void loggingPointcut() { }
 @AfterThrowing(pointcut = "loggingPointcut()", throwing = "e")
 public void logAfterThrowing( JoinPoint joinPoint, Throwable e) {
 :
 }
 @Around("loggingPointcut()")
 public Object logAround(
 ProceedingJoinPoint joinPoint) throws Throwable {
 :
 }
 BPQMPHHJOH-PHHJOH"TQFDU +)JQTUFSͰ͸ϩάग़ྗʹ"01Λ׆༻͍ͯ͠·͢ɻ MPHHJOH1PJOUDVUͰϩάग़ྗ͢ΔൣғΛࢦఆͯ͠ɺϝιουͷ։࢝ɾऴྃ΍ྫ֎ൃੜ࣌ ͷϩάग़ྗ͕Ͱ͖ΔΑ͏ʹͳ͍ͬͯ·͢ɻ ϩάग़ྗ ൣғͷࢦఆ ϝιουͷ ։࢝ɾऴྃ ྫ֎ൃੜ࣌
  77.  ϩάग़ྗ @Configuration
 @EnableAspectJAutoProxy
 public class LoggingAspectConfiguration {
 
 @Bean


    @Profile(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)
 public LoggingAspect loggingAspect(Environment env) {
 return new LoggingAspect(env);
 }
 }
 DPOpH-PHHJOH"TQFDU$POpHVSBUJPO "01Λར༻ͯ͠ग़ྗ͢Δϩά͸ɺ։ൃϞʔυ͚ͩͰ༗ޮͱͳΔઃఆʹͳ͍ͬͯ·͢ɻ 1SPpMFΞϊʔςʔγϣϯΛ༻͍Δ͜ͱͰɺಛఆͷ؀ڥԼͰͷΈ#FBOఆٛΛ༗ޮʹ͢Δ͜ͱ͕ ՄೳͱͳΓ·͢ɻ ։ൃ࣌ͷΈ༗ޮ
  78.  ϩάग़ྗ @GetMapping("/logs")
 @Timed
 public List<LoggerVM> getList() {
 LoggerContext context

    = (LoggerContext) LoggerFactory.getILoggerFactory();
 return context.getLoggerList()
 .stream()
 .map(LoggerVM::new)
 .collect(Collectors.toList());
 }
 XFCSFTU-PHT3FTPVSDF ·ͨɺϩάઃఆΛฦ͢8FC"1*͕+)JQTUFSͰ࠷ॳ͔Β༻ҙ͞Ε͍ͯ·͢ɻ ্ͷίʔυ͸ɺϩάઃఆΛฦ͢8FCϋϯυϥʔͰ͢ɻ
  79.  ϩάग़ྗ @PutMapping("/logs")
 @ResponseStatus(HttpStatus.NO_CONTENT)
 @Timed
 public void changeLevel(@RequestBody LoggerVM jsonLogger)

    {
 LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
 context.getLogger(jsonLogger.getName()) .setLevel(Level.valueOf(jsonLogger.getLevel()));
 }
 XFCSFTU-PHT3FTPVSDF ͞Βʹ͸ɺϩάϨϕϧΛมߋ͢Δ8FCϋϯυϥʔ΋༻ҙ͍ͯ͠·͢ʂ
  80.  ϩάग़ྗ ઌ΄Ͳͷ8FC"1*Λ༻͍Δ͜ͱͰɺ؅ཧϩάͷը໘͕࣮ݱ͞Ε͍ͯ·͢ʂ

  81.  ϩάग़ྗ public LoggingConfiguration(…) {
 :
 if (jHipsterProperties.getLogging() .getLogstash().isEnabled()) {


    addLogstashAppender(context);
 :
 }
 }
 DPOpH-PHHJOH$POpHVSBUJPO +)JQTUFSͰ͸ɺMPHTUBTIͱ࿈ܞ͢Δίʔυ΋༻ҙ͞Ε͍ͯ·͢ɻ ઃఆΛ௥Ճ͢Δ͜ͱͰɺϩά಺༰ΛඇಉظʹMPHTUBTI΁࿈ܞͰ͖·͢ɻ
  82.  Here!

  83.  ೝূͬͯͲ͏͢Ε͹͍͍ͷͰ͠ΐ͏ʁ ैདྷͷηογϣϯํࣜͰ͍͍ͷ͔ͳʁ ࠷ۙͰ͸ɺ0"VUIΛ༻͍ͨೝূํࣜͱ͔৭ʑฉ͍ͨΓ΋͠·͕͢ɻ ? ? ؂ࠪূ੻ 3&45GVM"1* Τϥʔॲཧ ϖʔδϯά

    ޮ཰ྑ͍։ൃ ӡ༻ ηΩϡϦςΟ ΞϓϦߏ੒ ϩάग़ྗ ೝূ
  84.  ೝূ )5514FTTJPO"VUIFOUJDBUJPO TUBUFGVM EFGBVMU4QSJOH4FDVSJUZNFDIBOJTN 0"VUI"VUIFOUJDBUJPO TUBUFMFTT XJUIBO0"VUITFSWFSJNQMFNFOUBUJPO +85BVUIFOUJDBUJPO TUBUFMFTT

    XJUIBUPLFO +)JQTUFSͰ͸ɺΞϓϦέʔγϣϯ࡞੒࣌ʹ ैདྷͷ)551ηογϣϯΛ༻͍ͨೝূํࣜͷ΄͔ɺ 0"VUI΍+85Λ༻͍ͨೝূํࣜΛબ୒͢Δ͜ͱ͕ग़དྷ·͢ɻ
  85.  ೝূ )5514FTTJPO"VUIFOUJDBUJPO ݹయతͳ4QSJOH4FDVSJUZͷೝূϝΧχζϜͰ͢ɻ )551ηογϣϯΛ࢖༻͢ΔͷͰɺεςʔτϑϧɻ ΞϓϦέʔγϣϯΛෳ਺ͷαʔόʔʹεέʔϧ͢Δ৔߹ɺ εςΟοΩʔηογϣϯΛ࣋ͭϩʔυόϥϯα͕ඞཁͰ͢ɻ

  86.  ೝূ 0"VUI"VUIFOUJDBUJPO εςʔτϨεͳηΩϡϦςΟϝΧχζϜͰ͢ɻ 4QSJOH4FDVSJUZ0"VUIΛ༻͍࣮ͯݱ͍ͯ͠·͢ɻ ηΩϡϦςΟτʔΫϯΛ֨ೲ͢ΔͨΊʹσʔλϕʔεςʔϒϧ͕ඞཁɻ

  87.  ೝূ 0"VUI"VUIFOUJDBUJPO $MJFOU +)JQTUFS"QQ ೝূαʔό Ϧιʔεαʔό 3FTPVSDF0XOFS 1BTTXPSE$SFEFOUJBMT "DDFTT5PLFO

    8FCΞϓϦέʔγϣϯ͕ɺೝূαʔό݉ϦιʔεαʔόʹͳΔΠϝʔδɻ ೝূ͸ʮ3FTPVSDF0XOFS1BTTXPSE$SFEFOUJBMTάϥϯτछผʯͰ࣮ࢪɻ
  88.  ೝূ +85"VUIFOUJDBUJPO +40/8FCτʔΫϯΛ༻͍ͨεςʔτϨεͳηΩϡϦςΟʔػߏͰ͢ɻ ෳ਺ͷαʔόʔʹΞϓϦέʔγϣϯΛεέʔϧ͍ͨ͠৔߹ʹศརɻ ӬଓԽϝΧχζϜΛඞཁͱ͠ͳ͍ͨΊɺ0"VUIΑΓ΋࢖༻ͱ࣮૷ ͕؆୯ɻ ϩάΠϯ໊ͱݖݶΛอ࣋͢Δ҆શͳτʔΫϯΛ࢖༻ɻ τʔΫϯ͸ॺ໊͞Ε͍ͯΔͨΊɺத਎ΛݟΔ͜ͱ͸Ͱ͖Δ͚Ͳɺ Ϣʔβʔ͕มߋ͢Δ͜ͱ͕Ͱ͖ͳ͍ɻ

  89.  ೝূ +85BVUIFOUJDBUJPO $MJFOU +)JQTUFS"QQ +85'JMUFS ίϯτϩʔϥ JWT

  90.  ೝূ +TPO8FC5PLFO FZ+IC(DJ0J+*6[6Y.J+FZ+[E8*J0J+I;(QCJ*T*N'E(HJ0J +45Y'9'&56M0-'+15&7G77/'6J*T*N7D$*.52/5& /K&/OW3H;FY4/UYBH(ORSVN*7HRQ)""#EE&5@L NR-R";X9"49ZMIF%E,L*VXE5&:5[,4%S8STK1 GKH ্ͷจࣈ͸ɺ+)JQTUFSͰੜ੒͞Εͨ8FCΞϓϦέʔγϣϯͷϦΫΤετϔομ Ͱૹ৴͞Ε͍ͯΔ+85Ͱ͢ɻ

    +85͸)&"%&3ɺ1":-0"%ɺ7&3*':4*(/"563&ͷͭͷ෦෼Ͱߏ੒ ͞Ε͍ͯ·͢ɻ
  91.  ೝূ +TPO8FC5PLFO FZ+IC(DJ0J+*6[6Y.J+FZ+[E8*J0J+I;(QCJ*T*N'E(HJ0J +45Y'9'&56M0-'+15&7G77/'6J*T*N7D$*.52/5& /K&/OW3H;FY4/UYBH(ORSVN*7HRQ)""#EE&5@L NR-R";X9"49ZMIF%E,L*VXE5&:5[,4%S8STK1 GKH )&"%&3ʹ͸ΞϧΰϦζϜ͕ࣔ͞Ε͓ͯΓɺ \

    BMH)4 ^
  92.  ೝূ +TPO8FC5PLFO FZ+IC(DJ0J+*6[6Y.J+FZ+[E8*J0J+I;(QCJ*T*N'E(HJ0J +45Y'9'&56M0-'+15&7G77/'6J*T*N7D$*.52/5& /K&/OW3H;FY4/UYBH(ORSVN*7HRQ)""#EE&5@L NR-R";X9"49ZMIF%E,L*VXE5&:5[,4%S8STK1 GKH 1":-0"%ʹ͸ೝূσʔλ͕ೖ͍ͬͯ·͢ɻ \

    TVCBENJO  BVUI30-&@"%.*/ 30-&@64&3  FYQ ^
  93.  @PostMapping("/authenticate")
 public ResponseEntity authorize(...) {
 : boolean rememberMe =

    (loginVM.isRememberMe() == null) ? false : loginVM.isRememberMe();
 String jwt = tokenProvider.createToken( authentication, rememberMe);
 response.addHeader(JWTConfigurer.AUTHORIZATION_HEADER, "Bearer " + jwt);
 return ResponseEntity.ok(new JWTToken(jwt));
 :
 TFDVSJUZKXU+85'JMUFS ೝূ ্ͷίʔυ͸+85Λ༻͍ͨೝূ෦෼Ͱ͢ɻ ೝূ0,ͷ৔߹ɺ+85τʔΫϯΛ࡞੒ͯ͠ɺ)551Ϩεϙϯεͱͯ͠ฦ٫͍ͯ͠·͢ɻ +85ੜ੒ )551Ϩεϙϯεͱͯ͠ฦ٫
  94.  @Override
 public void doFilter(…) throws … {
 : String

    jwt = resolveToken(httpServletRequest);
 if (StringUtils.hasText(jwt) && this.tokenProvider.validateToken(jwt)) {
 Authentication authentication = this.tokenProvider.getAuthentication(jwt);
 SecurityContextHolder.getContext() .setAuthentication(authentication);
 }
 filterChain.doFilter(servletRequest, servletResponse);
 : TFDVSJUZKXU+85'JMUFS ೝূ ্ͷίʔυ͸+85'JMUFSͷ࣮૷Ͱ͢ɻ )551ϦΫΤετϔομͷτʔΫϯΛݕূͯ͠ɺೝূ͢ΔγϯϓϧͳίʔυͰ͢ɻ ϦΫΤετ͔Β KXUऔಘ KXU͕༗ޮͳΒ KXU͔Β ೝূ࡞੒
  95.  ೝূ )5514FTTJPO"VUIFOUJDBUJPO TUBUFGVM EFGBVMU4QSJOH4FDVSJUZNFDIBOJTN 0"VUI"VUIFOUJDBUJPO TUBUFMFTT XJUIBO0"VUITFSWFSJNQMFNFOUBUJPO +85BVUIFOUJDBUJPO TUBUFMFTT

    XJUIBUPLFO ݸਓతʹ͸ɺ 440ͱ͔Λߟ͑ͳ͚Ε͹ʣγϯϓϧͳ+85Λ༻͍ͨೝূํ͕ࣜ޷ΈͰ͢ɻ
  96.  4QSJOH4FDVSJUZɺઃఆ͕େมͰ͢ΑͶʁ ݁ہɺͳʹΛͲ͏ઃఆ͢Ε͹͍͍ΜͰ͚ͨͬ͠ʁ ͱ೰Ή͜ͱ΋͋Γ·͢ɻ ? ? ؂ࠪূ੻ 3&45GVM"1* Τϥʔॲཧ ϖʔδϯά

    ޮ཰ྑ͍։ൃ ӡ༻ ΞϓϦߏ੒ ϩάग़ྗ ೝূ ηΩϡϦςΟ
  97.  ηΩϡϦςΟ +)JQTUFSͰ͸ɺ"OHVMBS 4QSJOHͷߏ੒ʹదͨ͠ηΩϡϦςΟઃఆ͕ɺ ࣍ͷ+BWB$POpHͱͯ͠༻ҙ͞ΕΔͷͰศརͰ͢ʂ ɹɾ4FDVSJUZ$POpHVSBUJPO ɹɾ8FC$POpHVSFS ͦͷத͔Βɺز͔ͭͷηΩϡϦςΟઃఆΛ঺հ͠·͢ɻ

  98.  @Override
 protected void configure(HttpSecurity http) throws Exception {
 http


    .csrf()
 .csrfTokenRepository( CookieCsrfTokenRepository.withHttpOnlyFalse()) :
 } DPOpH4FDVSJUZ$POpHVSBUJPO ηΩϡϦςΟ $43'ରࡦͷઃఆͰ͢ɻ +)JQTUFSͰ͸ɺϑϩϯτΤϯυͷ"OHVMBSʹదͨ͠$43'ઃఆ͕͞Ε͍ͯ·͢ɻ 0"VIU΍+85Λೝূํࣜʹબ୒ͨ͠৔߹ɺ$43'ରࡦ͸ແޮͱͳΓ·͢ɻ
  99.  ೝূ $MJFOU +)JQTUFS"QQ <)551ϔομ> 9943'50,&/$43'τʔΫϯ 4FU$PPLJF 943'50,&/$43'τʔΫϯ "OHVMBSͷྲّྀʹԊͬͯɺ$43'τʔΫϯ͸$PPLJFͷʮ943'50,&/ʯʹઃఆͯ͠ฦ͠ɺ ϦΫΤετϔομͷʮ9943'50,&/ʯͰड͚औΓ·͢ɻ

    +BWB4DSJQU͔Β$PPLJFΛࢀর͢Δඞཁ͕͋ΔͨΊɺ$PPLJFͷ)UUQ0OMZଐੑΛGBMTFʹ ઃఆ͍ͯ͠·͢ɻ
  100.  @Override
 protected void configure(HttpSecurity http) throws Exception {
 http


    :
 .and()
 .addFilterBefore( corsFilter, UsernamePasswordAuthenticationFilter.class)
 :
 } DPOpH4FDVSJUZ$POpHVSBUJPO ηΩϡϦςΟ $034 $SPTT0SJHJO3FTPVSDF4IBSJOH ͷઃఆ΋ͯ͘͠Ε͍ͯ·͢ʂ 6TFSOBNF1BTTXPSE"VUIFOUJDBUJPO'JMUFSͷલʹDPST'JMUFSΛ௥Ճ͍ͯ͠·͢ɻ
  101.  @Bean
 public CorsFilter corsFilter() {
 UrlBasedCorsConfigurationSource source = new

    UrlBasedCorsConfigurationSource();
 CorsConfiguration config = jHipsterProperties.getCors();
 if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) {
 source.registerCorsConfiguration("/api/**", config);
 source.registerCorsConfiguration("/v2/api-docs", config);
 }
 return new CorsFilter(source);
 }
 DPOpH8FC$POpHVSBUJPO ηΩϡϦςΟ ϓϩύςΟʹ$034ͷઃఆ͕͋Δ৔߹ɺ$034ઃఆ͕༗ޮʹͳΓ·͢ɻ ͳ͓ɺσϑΥϧτͰ͸։ൃϞʔυͷΈɻ͢΂ͯͷ0SJHJO͕ڐՄͰઃఆ͞Ε͍ͯ·͢ɻ $034ઃఆ͕ ༗ޮͳ৔߹
  102.  @Override
 protected void configure(HttpSecurity http) throws Exception {
 http


    :
 .and()
 :
 .exceptionHandling()
 .authenticationEntryPoint( http401UnauthorizedEntryPoint() )
 :
 } DPOpH4FDVSJUZ$POpHVSBUJPO ηΩϡϦςΟ ೝূΤϥʔ͕ൃੜͨ͠৔߹ʹͷεςʔλείʔυΛฦ͢ઃఆΛ͍ͯ͠·͢ɻ ͜ͷઃఆΛ͠ͳ͍ͱɺ-PHJO6SM"VUIFOUJDBUJPO&OUSZ1PJOU͕༗ޮʹͳͬͯ ೝূΤϥʔ࣌ʹϩάΠϯϖʔδ͕දࣔ͞Ε·͢ɻ Λฦ͢ઃఆ
  103.  @Override
 public void configure(WebSecurity web) throws Exception {
 web.ignoring()


    .antMatchers(HttpMethod.OPTIONS, "/**")
 .antMatchers("/app/**/*.{js,html}")
 .antMatchers("/bower_components/**")
 .antMatchers("/i18n/**")
 .antMatchers("/content/**")
 .antMatchers("/swagger-ui/index.html")
 .antMatchers("/test/**")
 .antMatchers("/h2-console/**");
 }
 DPOpH4FDVSJUZ$POpHVSBUJPO ηΩϡϦςΟ 4QSJOH4FDVSJUZͷର৅֎ͱ͢Δ63-΋ઃఆ͞Ε͍ͯΔͷͰศརͰ͢ɻ ৽͘͠ର৅֎ͱ͢Δ63-Λ௥Ճ͢Δ৔߹ɺ͜͜ͷઃఆʹ௥Ճ͢Ε͹େৎ෉Ͱ͢ɻ
  104.  ؂ࠪূ੻ΛͱΔΑ͏ʹ͓٬͞ΜʹݴΘΕ͚ͨͲɺɺ Ͳ͏͢Δͷ͕Ұ൪͍͍ͷͰ͠ΐ͏Ͷʁ ? ? 3&45GVM"1* Τϥʔॲཧ ϖʔδϯά ޮ཰ྑ͍։ൃ ӡ༻

    ηΩϡϦςΟ ΞϓϦߏ੒ ϩάग़ྗ ೝূ ؂ࠪূ੻
  105.  dependencies {
 :
 compile "org.springframework.boot:spring-boot-actuator"
 :
 } CVJMEHSBEMF 4QSJOH#PPU"DUVBUPS͸ɺ؂ࠪূ੻ͷػೳΛఏڙͯ͘͠Ε·͢ʂ

    ؂ࠪূ੻
  106.  public interface AuditEventRepository {
 void add(AuditEvent event);
 List<AuditEvent> find(Date

    after);
 List<AuditEvent> find(String principal, Date after);
 List<AuditEvent> find(String principal, Date after, String type);
 
 }
 PSHTQSJOHGSBNFXPSLCPPUBDUVBUFBVEJU"VEJU&WFOU3FQPTJUPSZ ؂ࠪূ੻ 4QSJOH#PPU"DUVBUPSʹ༻ҙ͞Εͨ"VEJU&WFOU3FQPTJUPSZΠϯλϑΣʔεΛ࣮૷͢Δ͜ͱͰɺ ؂ࠪূ੻ͷΠϕϯτΛऔಘͰ͖·͢ɻ
  107.  /**
 * An implementation of Spring Boot's AuditEventRepository.
 */


    @Repository
 public class CustomAuditEventRepository implements AuditEventRepository {
 
 private final PersistenceAuditEventRepository persistenceAuditEventRepository;
 
 private final AuditEventConverter auditEventConverter;
 :
 } PSHTQSJOHGSBNFXPSLCPPUBDUVBUFBVEJU"VEJU&WFOU3FQPTJUPSZ ؂ࠪূ੻ +)JQTUFSͰ͸ɺ"VEJU&WFOU3FQPTJUPSZΠϯλϑΣʔεΛ࣮૷ͨ͠ɺ $VTUPN"VEJU&WFOU3FQPTJUPSZ͕༻ҙ͞Ε͍ͯ·͢ɻ
  108.  ؂ࠪূ੻ $VTUPN "VEJU&WFOU3FQPTJUPSZ 1FSTJTUFODF "VEJU&WFOU3FQPTJUPSZ +)*@1&34*45&/5@"6%*5@&7&/5 +)*@1&34*45&/5@"6%*5@&75@%"5" $VTUPN"VEJU&WFOU3FQPTJUPSZ͕1FSTJTUFODF"VEJU&WFOU3FQPTJUPSZΛݺͼग़͢͜ͱͰɺ σʔλϕʔεʹ؂ࠪূ੻Λอଘ͠·͢ɻ

  109.  ؂ࠪূ੻

  110.  ؂ࠪূ੻ ؂ࠪূ੻͸ɺ؅ཧ؂ࠪͷը໘Ͱࢀর͢Δ͜ͱ͕ग़དྷ·͢ɻ

  111.  +40/Λฦ͢8FC"1*ͰϖʔδωʔγϣϯΛ࣮૷͢Δ৔߹ɺલʗޙϖʔδ΍ ࠷ॳʗ࠷ޙͷϖʔδͷΑ͏ͳ৘ใΛͲ͏ฦ٫͢Ε͹͍͍ͷͰ͠ΐ͏ʁ +40/ͷதʢϨεϙϯεͷϘσΟʣ৘ใΛೖΕΔʁ ϨεϙϯεϔομʹೖΕΔʁ ? ? ؂ࠪূ੻ ޮ཰ྑ͍։ൃ ӡ༻

    ΞϓϦߏ੒ ϩάग़ྗ ೝূ ηΩϡϦςΟ 3&45GVM"1* ϖʔδϯά Τϥʔॲཧ
  112.  @RestController
 @RequestMapping("/management/audits")
 public class AuditResource {
 
 @GetMapping
 public

    ResponseEntity<List<AuditEvent>> getAll( @ApiParam Pageable pageable) {
 Page<AuditEvent> page = auditEventService.findAll(pageable);
 HttpHeaders headers = PaginationUtil .generatePaginationHttpHeaders( page, "/management/audits");
 return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);
 }
 }
 XFCSFTU"VEJU3FTPVSDF 3&45ϖʔδϯά +)JQTUFSͰ͸ɺϖʔδϯάͷ৘ใ͸)551ϔομʹઃఆͯ͠ฦ͍ͯ͠·͢ɻ
  113.  3&45ϖʔδϯά 3'$ -JOLIFBEFS Ϩεϙϯεϔομʹϖʔδϯά৘ใΛೖΕΔํ๏ΛఏҊ͍ͯ͠Δ )551ϔομʹઃఆ͢Δϖʔδϯά৘ใ͸ɺ3'$ʹैͬͨ࢓༷Λ࠾༻͍ͯ͠·͢ɻ NBOBHFNFOUBVEJUT QBHFTJ[FSFMlMBTU  NBOBHFNFOUBVEJUT

    QBHFTJ[FSFMpSTU
  114.  ΤϥʔϋϯυϦϯά͸Ͳ͏ͨ͠Β͍͍ͷͰ͠ΐ͏ʁ 'JMUFS "01Λ࢖༻ͨ͠ྫ֎ิ଍ &YDFQUJPO)BOEMFS  ? ? ؂ࠪূ੻ ޮ཰ྑ͍։ൃ

    ӡ༻ ΞϓϦߏ੒ ϩάग़ྗ ೝূ ηΩϡϦςΟ 3&45GVM"1* ϖʔδϯά Τϥʔॲཧ
  115.  3&45Τϥʔॲཧ +)JQTUFSͰ͸ɺ!$POUSPMMFS"EWJDFΛ࢖ͬͯ ΤϥʔϋϯυϦϯάΛ͍ͯ͠·͢ɻ $POUSPMMFS"EWJDFΞϊςʔγϣϯΛ༻͍Δ͜ͱͰɺ $POUSPMMFSΛԣஅͯ͠ྫ֎ΛϋϯυϦϯά͢Δ͜ͱ͕ ՄೳͱͳΓ·͢ɻ

  116.  @ControllerAdvice
 public class ExceptionTranslator {
 
 @ExceptionHandler(ConcurrencyFailureException.class)
 @ResponseStatus(HttpStatus.CONFLICT)
 @ResponseBody


    public ErrorVM processConcurrencyError( ConcurrencyFailureException ex) {
 return new ErrorVM( ErrorConstants.ERR_CONCURRENCY_FAILURE);
 }
 :
 } SFTUFSSPST&YDFQUJPO5SBOTMBUPS 3&45Τϥʔॲཧ &YDFQUJPO5SBOTMBUPSΫϥεͷͳ͔ͰҰ௨ΓͷΤϥʔॲཧ͕ఆٛ͞Ε͍ͯ·͢ͷͰɺ ৽ͨʹΞϓϦέʔγϣϯಠࣗͷΤϥʔϋϯυϦϯάΛ௥Ճ͍ͨ͠৔߹ɺ ͜͜ʹ௥Ճ͢Ε͹͍͍͚ͩͰ͢ɻͱͯ΋ศརͰ͢ɻ ഉଞϩοΫʹ ࣦഊͨ͠৔߹  $POqJDU  Λฦ͢ɻ
  117.  ։ൃޮ཰Λ͋͛Δʹ͸Ͳ͏ͨ͠Β͍͍ͩΖ͏ʁ ͳΜ͔͍͍πʔϧͳ͍͔ͳʙʁͱ͔೰Έ·͢ΑͶɻ ? ? ؂ࠪূ੻ ӡ༻ ΞϓϦߏ੒ ϩάग़ྗ ೝূ

    ηΩϡϦςΟ 3&45GVM"1* ϖʔδϯά Τϥʔॲཧ ޮ཰ྑ͍։ൃ
  118.  :
 dependencies {
 compile "org.springframework.boot:spring-boot-devtools"
 }
 :
 QSPpMF@EFWHSBEMF ޮ཰ྑ͍։ൃ

    4QSJOH#PPU%FWUPPMTΛ༻͍Δ͜ͱʹΑΓɺΞϓϦέʔγϣϯΛlIPUSFTUBSUzͰ͖·͢ɻ ϓϩδΣΫτͷΫϥε͕ίϯύΠϧ͞ΕΔͱɺมߋΛݕ஌ͯ͠ΞϓϦΛ࠶ىಈ͠·͢ɻ +)JQTUFSͰ͸ɺ։ൃϞʔυͰىಈ͚ͨ࣌ͩ͜͠ͷػೳ͕༗ޮʹͳΔΑ͏ʹઃఆ͞Ε͍ͯ·͢ɻ :
 if (project.hasProperty('prod')) {
 apply from: 'gradle/profile_prod.gradle'
 } else {
 apply from: 'gradle/profile_dev.gradle'
 }
 : CVJMEHSBEMF
  119.  ޮ཰ྑ͍։ൃ σϑΥϧτઃఆͰ͸ɺ*OUFMMJ+*%&"͸ΞϓϦέʔγϣϯ࣮ߦதʹ ࣗಈίϯύΠϧ͠·ͤΜɻ ʮอଘ࣌ʹίϯύΠϧʯػೳΛ༗ޮʹ͢Δʹ͸ɺ *OUFMMJ+*%&"1SFGFSFODFT#VJME &YFDVUJPO %FQMPZNFOU$PNQJMFS Λબ୒ͯ͠ɺl.BLFQSPKFDUBVUPNBUJDBMMZzΛ༗ޮʹ͍ͯͩ͘͠͞ɻ ͦͷޙɺҎԼͷΩʔͰ"DUJPOXJOEPXΛ։͍ͯɺ

    -JOVY$53- 4)*'5 " .BD0494)*'5 $0.."/% " 8JOEPXT$53- "-5 4)*'5  ʮ3FHJTUSZʯͱೖྗ͠ɺzDPNQJMFSBVUPNBLFBMMPXXIFOBQQSVOOJOHzΛ ༗ޮʹ͍ͯͩ͘͠͞ɻ
  120.  +)JQTUFS͸։ൃऀ͕͙͢ʹ։ൃ͕Ͱ͖Δ؀ڥ͕੔͍ͬͯ·͢ɻ wϓϩδΣΫτͷHJU؅ཧͷͨΊͷHJUJHOPSF΍HJUBUUSJCVUFTϑΝΠϧ w։ൃ͔ΒϓϩμΫτ·ͰΛҙࣝͨ͠Ϗϧυఆٛ w&DMJQTFΛ*%&Ͱ࢖༻͢Δ৔߹ͷϓϩδΣΫτઃఆ w։ൃऀ͕͞·͟·ͳΤσΟλ΍*%&ͰҰ؏ͨ͠ίʔσΟϯάελΠϧΛఆٛ͠ɺ ҡ࣋͢ΔͨΊͷ&EJUPS$POpHઃఆ ͳͲͰ͢ɻ ޮ཰ྑ͍։ൃ

  121.  ӡ༻Λߟྀͨ͠ػೳΛ૊ΈࠐΈ͍ͨͷ͚ͩͲɺͲ͏͍͏͜ͱͨ͠Β͍͍ͩΖ͏ʁ ? ? ؂ࠪূ੻ ΞϓϦߏ੒ ϩάग़ྗ ೝূ ηΩϡϦςΟ 3&45GVM"1*

    ϖʔδϯά Τϥʔॲཧ ޮ཰ྑ͍։ൃ ӡ༻
  122.  ӡ༻ dependencies {
 :
 compile "org.springframework.boot:spring-boot-actuator"
 :
 } CVJMEHSBEMF

    4QSJOH#PPU"DUVBUPS͸ɺΞϓϦέʔγϣϯӡ༻Λָʹͯ͘͠ΕΔػೳΛఏڙͯ͘͠Ε·͢ɻ ɾ)551ΤϯυϙΠϯτͷ௥Ճ ɾϔϧενΣοΫ ɾϝτϦΫε ɾ؂ࠪূ੻
  123.  ӡ༻ ΤϯυϙΠϯτ આ໌ (&5BVUPDPOpH "VUP$POpHVSFͰ༗ޮʹͳ͍ͬͯΔ΋ͷɺແޮʹͳ͍ͬͯΔ΋ͷΛදࣔ͢Δ (&5CFBOT %*ίϯςφʹ؅ཧ͞Ε͍ͯΔ#FBOͷҰཡΛදࣔ͢Δ (&5FWO ؀ڥม਺ɺγεςϜϓϩύςΟͷҰཡΛදࣔ͢Δ

    (&5DPOpHQSPQT !$POpHVSBUJPO1SPQFSUJFTͷ෇͍ͨϓϩύςΟ஋ͷҰཡΛදࣔ͢Δ (&5EVNQ εϨουμϯϓΛදࣔ͢Δ (&5IFBMUI ϔϧενΣοΫͷ݁ՌΛදࣔ͢Δ (&5JOGP JOGP͔Β࢝·ΔϓϩύςΟ஋ͷҰཡͳͲͷΞϓϦέʔγϣϯ৘ใΛදࣔ͢Δ (&5MPHpMF ϩάϑΝΠϧΛදࣔ͢Δ (&5NFUSJDT ϝτϦΫεΛදࣔ͢Δ (&5TIVUEPXO ΞϓϦέʔγϣϯΛఀࢭ͢Δ (&5USBDF )551ϦΫΤετͷϩάΛදࣔ͢Δ (&5qZXBZɺ (&5MJRVJCBTF 'MBXBZ·ͨ͸-JRVJCBTFͷσʔλϕʔεϚΠάϨʔγϣϯ৘ใΛදࣔ͢Δ (Spring徹底入門 p.624より) 4QSJOH#PPU"DUVBUPSʹΑΓ্هͷΑ͏ͳ)551ΤϯυϙΠϯτ͕௥Ճ͞Ε·͢ɻ +)JQTUFSͰ͸ɺ͜ΕΒͷػೳΛ׆༻ͨ͠؅ཧػೳ͕ॆ࣮͍ͯ͠·͢ɻ
  124.  ӡ༻ DPOpHQSPQT΍FWOΛ༻͍ͨઃఆը໘

  125.  ӡ༻ IFBMUIΛ༻͍ͨϔϧενΣοΫը໘

  126.  ӡ༻ NFUSJDTΛ༻͍ͨΞϓϦέʔγϣϯϝτϦΫεը໘

  127.  ӡ༻ ը໘͕༻ҙ͞Ε͍ͯͳ͍΋ͷʹ͍ͭͯ΋ɺBENJOϢʔβͰ௚઀(&5Λୟ͘͜ͱͰɺ ৘ใΛදࣔͰ͖·͢ɻ CFBOT΍BVUPDPOpHͳͲͷ৘ใ͸։ൃʹ΋໾ཱͪ·͢ʂ

  128. "HFOEB (FUUJOH4UBSU +)JQTUFSͱ͸ -FBSOXJUI+)JQTUFS ·ͱΊ

  129.  ·ͱΊ +)JQTUFSΛ࢖͏͜ͱͰɺ͙͢ʹ࣮ӡ༻ʹ଱͑ΕΔ 8FCΞϓϦͷ਽ܗΛ༻ҙͰ͖·͢ʂ +)JQTUFS͕ग़ྗ͢Διʔείʔυʹ͸ ચ࿅͞Ε࣮ͨ૷ͷώϯτ͕ࢄΒ͹͍ͬͯ·͢ʂ

  130. (SFBU4QSJOH 'VO+)JQTUFS ʘ͢͝ʔ͍ʂͨͷ͠ʔʂʗ

  131. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ P ƅ˜ƅ P