{"id":12109,"date":"2016-11-25T09:00:06","date_gmt":"2016-11-25T00:00:06","guid":{"rendered":"http:\/\/www.techscore.com\/blog\/?p=12109"},"modified":"2018-11-14T16:33:44","modified_gmt":"2018-11-14T07:33:44","slug":"start-with-sts-and-spring-boot-2","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2016\/11\/25\/start-with-sts-and-spring-boot-2\/","title":{"rendered":"Spring Tool Suite (STS)\u3068 Spring Boot \u3067\u59cb\u3081\u308b Web \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\uff08\uff12\uff09"},"content":{"rendered":"
\u3053\u3093\u306b\u3061\u306f\u3002\u68b6\u539f\u3067\u3059\u3002<\/p>\n
\u300cSpring Tool Suite (STS)\u3068 Spring Boot \u3067\u59cb\u3081\u308b Web \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u300d\u306e\u7b2c2\u56de\u3067\u3059\u3002
\n3\u56de\u306b\u5206\u3051\u3066\u63b2\u8f09\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n
Spring Boot<\/a> \u306b\u3064\u3044\u3066\u306f TECHSCORE BLOG \u306e\u8a18\u4e8b\u300cSpring Boot \u5165\u9580<\/a>\u300d\u3082\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n \u524d\u56de\u306e\u8a18\u4e8b\u3067\u306f Spring Tool Suite (STS) \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u30ed\u30fc\u30ab\u30eb\u958b\u767a\u74b0\u5883\u3067\u30b5\u30fc\u30d0\u3092\u8d77\u52d5\u3057\u3066 Spring Legacy \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u753b\u9762\u3092\u8868\u793a\u3067\u304d\u308b\u307e\u3067\u3092\u5b9f\u65bd\u3057\u307e\u3057\u305f\u3002 STS \u3067 Spring Starter \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u3066\u753b\u9762\u306b Hello World \u3092\u8868\u793a\u3057\u307e\u3059\u3002\u4e0a\u8a18\u3067\u7d39\u4ecb\u3057\u305fTECHSCORE BLOG \u306e\u8a18\u4e8b\u300cSpring Boot \u5165\u9580<\/a>\u300d\u3068\u540c\u3058\u5185\u5bb9\u3067\u3059\u3002 Spring Starter \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306f Spring Boot \u7528\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3059\u3002 \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u8a2d\u5b9a\u306e\u305f\u3081\u306b\u753b\u9762\u304c3\u3064\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n File \u30e1\u30cb\u30e5\u30fc > New > Spring Starter Project \u3092\u30af\u30ea\u30c3\u30af\u3002 New Spring Starter Project \u8a2d\u5b9a\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u8a2d\u5b9a\u3092\u5165\u529b\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n Name \u306f\u300cDemoSpringBootApp\u300d\u3068\u3057\u307e\u3057\u305f\u3002 \u5f15\u304d\u7d9a\u304d\u8a2d\u5b9a\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n Dependencies \u306f\u300cWeb\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u3001\u958b\u3044\u305f\u9818\u57df\u306e\u300cWeb\u300d\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u3092\u30c1\u30a7\u30c3\u30af\u3002 \u6700\u5f8c\u306e\u8a2d\u5b9a\u753b\u9762\u3067\u3059\u3002<\/p>\n \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308bURL\u3092\u78ba\u8a8d\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u307e\u307e\u5909\u66f4\u3057\u307e\u305b\u3093\u3002 Finish \u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u300cDemoSpringBootApp\u300d\u306e\u4f5c\u6210\u304c\u5b8c\u4e86\u3057\u307e\u3059\u3002 \u4ee5\u4e0a\u306e\u624b\u9806\u3067\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210\u306f\u5b8c\u4e86\u3067\u3059\u3002 File \u30e1\u30cb\u30e5\u30fc > New > Class \u3092\u30af\u30ea\u30c3\u30af\u3002Eclipse \u3067 Java \u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408\u3068\u540c\u3058\u624b\u9806\u3067\u3059\u3002 Name:\u306f\u300cHelloController\u300d\u3068\u3057\u307e\u3057\u305f\u3002 Finish \u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u300cHelloController\u300d\u306e\u4f5c\u6210\u304c\u5b8c\u4e86\u3057\u307e\u3059\u3002 HelloController.java \u3092\u7de8\u96c6\u3057\u307e\u3059\u3002<\/p>\n \u6587\u5b57\u5217 \u201dHello World!\u201d \u3092\u30af\u30e9\u30a4\u30a2\u30f3\u30c8(Web \u30d6\u30e9\u30a6\u30b6)\u306b\u8fd4\u5374\u3059\u308b\u51e6\u7406\u3092\u8a18\u8ff0\u3057\u307e\u3057\u305f\u3002<\/p>\n \u30af\u30e9\u30b9\u5b9a\u7fa9\u306e\u524d\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3 @RestController \u306f\u3001\u3053\u306e\u30af\u30e9\u30b9\u304c REST\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3067\u3042\u308b\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n \u30af\u30e9\u30b9\u306b\u306f\u30e1\u30bd\u30c3\u30c9\u300cindex\u300d\u304c\u3042\u308a\u3001\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306b\u306f\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3 @RequestMapping \u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u30a2\u30c9\u30ec\u30b9\u300c\/\u300d\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u5834\u5408\u306b\u547c\u3073\u51fa\u3057\u3055\u308c\u308b\u30ea\u30af\u30a8\u30b9\u30c8\u30cf\u30f3\u30c9\u30e9\u3067\u3042\u308b\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n \u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306f\u305f\u3063\u305f\u3053\u308c\u3060\u3051\u3067\u3059\u3002 \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u300cDemoSpringBootApp\u300d\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3001Run As > Spring Boot App \u3092\u30af\u30ea\u30c3\u30af\u3002 \u3057\u3070\u3089\u304f\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30ed\u30b0\u304c\u51fa\u529b\u3055\u308c\u3001\u672b\u5c3e\u306b\u300cStarted DemoSpringBootAppApplication\u300d\u3068\u3042\u308a\u307e\u3059\u3002\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\u5b9f\u884c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n \u753b\u9762\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002 \u201dHello World!\u201d \u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n \u6700\u5f8c\u306b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u505c\u6b62\u3057\u307e\u3057\u3087\u3046\u3002 \u4e0b\u6e96\u5099\u306a\u3057\u3001\u30b7\u30f3\u30d7\u30eb\u306a\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306e\u30b3\u30fc\u30c9\u3060\u3051\u3067 Web \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u3057\u3066\u5b9f\u884c\u3067\u304d\u307e\u3057\u305f\u3002 \u3053\u3093\u306b\u3061\u306f\u3002\u68b6\u539f\u3067\u3059\u3002<\/p>\n \u300cSpring Tool Suite (STS)\u3068 Spring Boot \u3067\u59cb\u3081\u308b Web \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u300d\u306e\u7b2c2\u56de\u3067\u3059\u3002
\n\u4eca\u56de\u306f Spring Starter \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u5229\u7528\u3057\u3066 Spring Boot \u3067\u753b\u9762\u3092\u8868\u793a\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\u3053\u306e\u8a18\u4e8b\u306e\u30b4\u30fc\u30eb<\/h2>\n
\nSTS \u3067\u306f\u306a\u304f\u3066\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u64cd\u4f5c\u3057\u305f\u3044\u3068\u3044\u3046\u65b9\u306f\u3001\u4e0a\u8a18\u306e\u8a18\u4e8b\u3084 Spring4 \u306b\u306a\u308a\u307e\u3059\u304c TECHSCORE BLOG \u306e\u8a18\u4e8b\u300cMaven3 \u3068 Spring4 \u3067\u306f\u3058\u3081\u308b Hello, World!<\/a>\u300d\u3082\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\u74b0\u5883<\/h2>\n
\n
Spring Starter \u30d7\u30ed\u30b8\u30a7\u30af\u30c8<\/h2>\n
\n\u524d\u56de\u306e\u8a18\u4e8b\u3067\u4f5c\u6210\u3057\u305f Spring Legacy \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306f Spring Boot \u4ee5\u5916\u306e Spring Framework \u3067\u5229\u7528\u3059\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3057\u305f\u3002<\/p>\n\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210<\/h2>\n
\n<\/a><\/p>\n
\nGroup \u306f\u300ccom.techscore.springboot\u300d\u3001Artifact \u306f\u300cDemoSpringBootApp\u300d\u3001Package \u306f\u300ccom.techscore.springboot\u300d\u3068\u3057\u307e\u3059\u3002
\nNext \u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002
\n<\/a><\/p>\n
\nNext \u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002
\n<\/a><\/p>\n
\n<\/a><\/p>\n
\n<\/a><\/p>\n
\n\u6b21\u306e\u624b\u9806\u3067\u306f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u30fb\u7de8\u96c6\u3057\u307e\u3059\u3002<\/p>\n\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u30fb\u7de8\u96c6<\/h2>\n
\nNew Java Class \u8a2d\u5b9a\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001\u30af\u30e9\u30b9\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n
\n<\/a><\/p>\n
\n<\/a><\/p>\n
\r\npackage com.techscore.springboot;\r\n\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\nimport org.springframework.web.bind.annotation.RestController;\r\n\r\n@RestController\r\npublic class HelloController {\r\n\t@RequestMapping(\"\/\")\r\n\tpublic String index() {\r\n\t\treturn \"Hello World!\";\r\n\t}\r\n}\r\n<\/pre>\n
\n\u305d\u308c\u3067\u306f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u5b9f\u884c\u3057\u3066\u753b\u9762\u306b\u30a2\u30af\u30bb\u30b9<\/h2>\n
\n<\/a><\/p>\n
\r\n . ____ _ __ _ _\r\n \/\\\\ \/ ___'_ __ _ _(_)_ __ __ _ \\ \\ \\ \\\r\n( ( )\\___ | '_ | '_| | '_ \\\/ _` | \\ \\ \\ \\\r\n \\\\\/ ___)| |_)| | | | | || (_| | ) ) ) )\r\n ' |____| .__|_| |_|_| |_\\__, | \/ \/ \/ \/\r\n =========|_|==============|___\/=\/_\/_\/_\/\r\n :: Spring Boot :: (v1.4.1.RELEASE)\r\n<\/pre>\n
\nhttp:\/\/localhost:8080\/
\n<\/a><\/p>\n
\u5b9f\u884c\u3057\u305f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u505c\u6b62<\/h2>\n
\nConsole \u30d3\u30e5\u30fc\u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u505c\u6b62\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u505c\u6b62\u3055\u308c\u307e\u3059\u3002
\n<\/a><\/p>\n
\u307e\u3068\u3081<\/h2>\n
\nEclipse \u306e\u64cd\u4f5c\u306b\u6163\u308c\u3066\u3044\u308b\u4eba\u306f\u308f\u305a\u304b\u6570\u5206\u3067\u753b\u9762\u8868\u793a\u307e\u3067\u5b8c\u4e86\u3067\u304d\u305f\u306e\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002
\n\u6b21\u56de\u306f\u30d5\u30a9\u30fc\u30e0\u3092\u4f5c\u6210\u3057\u3001\u5165\u529b\u3057\u305f\u5185\u5bb9\u3092\u30d6\u30e9\u30a6\u30b6\u306b\u8868\u793a\u3055\u305b\u3066\u307f\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\n3\u56de\u306b\u5206\u3051\u3066\u63b2\u8f09\u3057\u3066\u3044\u307e\u3059\u3002
\u7d9a\u304d\u3092\u8aad\u3080...<\/a><\/p>\n","protected":false},"author":31,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[57,136,122],"_links":{"self":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/12109"}],"collection":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/users\/31"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/comments?post=12109"}],"version-history":[{"count":57,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/12109\/revisions"}],"predecessor-version":[{"id":12408,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/12109\/revisions\/12408"}],"wp:attachment":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/media?parent=12109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/categories?post=12109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/tags?post=12109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}