{"id":22132,"date":"2015-07-17T22:04:29","date_gmt":"2015-07-17T16:34:29","guid":{"rendered":"https:\/\/tothenewco.pro\/blog\/?p=22132"},"modified":"2015-07-17T22:04:29","modified_gmt":"2015-07-17T16:34:29","slug":"quick-start-with-springboot-using-cli","status":"publish","type":"post","link":"https:\/\/tothenewco.pro\/blog\/quick-start-with-springboot-using-cli\/","title":{"rendered":"Quick start with Springboot using CLI"},"content":{"rendered":"<p>SpringBoot is one of the main projects of Spring community which takes opinionated view of production ready applications. It helps you getting up and running a production grade spring application. <\/p>\n<p>It comes with even a CLI to get you quick started with springboot. CLI stands for Command Line Interface which gives *spring* command using which the application could be run.<\/p>\n<p>This CLI allows you to create a groovy script called Spring script in Springboot documentation which could be run as a spring application using simple command <\/p>\n<p><code>spring run file_name.groovy<\/code><\/p>\n<p>A simple example of a Spring script could be as below:<br \/>\n[code lang=&#8221;groovy&#8221;]<br \/>\n@Controller<br \/>\nclass Example {<br \/>\n\t@RequestMapping(&quot;\/&quot;)<br \/>\n    @ResponseBody<br \/>\n\tpublic String helloWorld() {<br \/>\n\t\t&quot;Hello Spring boot audience!!!&quot;<br \/>\n\t}<br \/>\n}<br \/>\n[\/code]<\/p>\n<p>This script just by default imports few annotation classes(e.g. Controller,ResponseBody and RequestMApping above) and add  annotations when run with CLI. In normal spring application without a springboot CLI but with springboot would require to add the imports for these.<\/p>\n<p>Below are the annotations added itself by CLI.<br \/>\n[code lang=&#8221;groovy&#8221;]<br \/>\n@Grab(&quot;org.springframework.boot:spring-boot-web-starter:0.5.0&quot;)<br \/>\n@EnableAutoConfiguration<br \/>\n[\/code]<br \/>\n@Grab annotation is used to add a starter pom. A starter pom is nothing but a collection of jars dependencies and plugins grouped together.<br \/>\nAdded above is the web starter which provides sensible defaults for a spring web applications.<br \/>\n@EnableAutoConfiguration enables default confiurations and best tries to configure the application by looking up in added jar files. For example if you have embedded a tomcat-embed.jar then it considers that you want to use tomcat.<\/p>\n<p>More, you can create FAT jars(A fat jar is simply a jar that contains all the required jars within single jar and hence can be run independently) using command below<\/p>\n<p><code>spring jar test.jar file_name.groovy<\/code><\/p>\n<p>This will create a excutable jar which could be run using following basic java command<\/p>\n<p><code>java -jar jar_file<\/code><\/p>\n<p>Springboot CLI could be installed if using GVM by running following command:<\/p>\n<p><code>gvm install springboot<\/code><\/p>\n<p>gvm is independent of OS. Though if using MAC and using Homebrew, all you need to do to install the Spring Boot CLI is:<\/p>\n<p><code>$ brew tap pivotal\/tap<br \/>\n$ brew install springboot<\/code><br \/>\nHomebrew will install spring to \/usr\/local\/bin. <\/p>\n<p>Note:If you don\u2019t see the formula, your installation of brew might be out-of-date. Just execute <\/p>\n<p><code>brew update<\/code><\/p>\n<p>and try again.<\/p>\n<p>If you are on a Mac and using MacPorts, all you need to do to install the Spring Boot CLI is: <\/p>\n<p><code>$ sudo port install spring-boot-cli <\/code><\/p>\n<p>Least but not last, springboot CLI should not be used for production stuff and just for testing and hands on purpose.<\/p>\n<p>Finally, springboot CLI is no way required or must to run a springboot rich spring application, it is just a hands on tool.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SpringBoot is one of the main projects of Spring community which takes opinionated view of production ready applications. It helps you getting up and running a production grade spring application. It comes with even a CLI to get you quick started with springboot. CLI stands for Command Line Interface which gives *spring* command using which [&hellip;]<\/p>\n","protected":false},"author":119,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":4,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-22132","post","type-post","status-publish","format-standard","hentry","category-technology"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"SpringBoot is one of the main projects of Spring community which takes opinionated view of production ready applications. It helps you getting up and running a production grade spring application. It comes with even a CLI to get you quick started with springboot. CLI stands for Command Line Interface which gives *spring* command using which\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Vinay Prajapati\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/tothenewco.pro\/blog\/quick-start-with-springboot-using-cli\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Quick start with Springboot using CLI | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"SpringBoot is one of the main projects of Spring community which takes opinionated view of production ready applications. It helps you getting up and running a production grade spring application. It comes with even a CLI to get you quick started with springboot. CLI stands for Command Line Interface which gives *spring* command using which\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/tothenewco.pro\/blog\/quick-start-with-springboot-using-cli\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"article:tag\" content=\"technology\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2015-07-17T16:34:29+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2015-07-17T16:34:29+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Quick start with Springboot using CLI | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"SpringBoot is one of the main projects of Spring community which takes opinionated view of production ready applications. It helps you getting up and running a production grade spring application. It comes with even a CLI to get you quick started with springboot. CLI stands for Command Line Interface which gives *spring* command using which\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/quick-start-with-springboot-using-cli\\\/#article\",\"name\":\"Quick start with Springboot using CLI | TO THE NEW Blog\",\"headline\":\"Quick start with Springboot using CLI\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/banti-prajapati\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2015-07-17T22:04:29+05:30\",\"dateModified\":\"2015-07-17T22:04:29+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/quick-start-with-springboot-using-cli\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/quick-start-with-springboot-using-cli\\\/#webpage\"},\"articleSection\":\"Technology\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/quick-start-with-springboot-using-cli\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"position\":2,\"name\":\"Technology\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/quick-start-with-springboot-using-cli\\\/#listItem\",\"name\":\"Quick start with Springboot using CLI\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/quick-start-with-springboot-using-cli\\\/#listItem\",\"position\":3,\"name\":\"Quick start with Springboot using CLI\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/banti-prajapati\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/banti-prajapati\\\/\",\"name\":\"Vinay Prajapati\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/quick-start-with-springboot-using-cli\\\/#authorImage\",\"url\":\"https:\\\/\\\/newersworld-sf-static.tothenew.net\\\/prod\\\/profilePicFolder\\\/1e6eb582-cd9f-416a-840d-4ea31be5ee61_vinay.prajapati@tothenew.com.jpg\",\"width\":96,\"height\":96,\"caption\":\"Vinay Prajapati\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/quick-start-with-springboot-using-cli\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/quick-start-with-springboot-using-cli\\\/\",\"name\":\"Quick start with Springboot using CLI | TO THE NEW Blog\",\"description\":\"SpringBoot is one of the main projects of Spring community which takes opinionated view of production ready applications. It helps you getting up and running a production grade spring application. It comes with even a CLI to get you quick started with springboot. CLI stands for Command Line Interface which gives *spring* command using which\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/quick-start-with-springboot-using-cli\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/banti-prajapati\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/banti-prajapati\\\/#author\"},\"datePublished\":\"2015-07-17T22:04:29+05:30\",\"dateModified\":\"2015-07-17T22:04:29+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Quick start with Springboot using CLI | TO THE NEW Blog","description":"SpringBoot is one of the main projects of Spring community which takes opinionated view of production ready applications. It helps you getting up and running a production grade spring application. It comes with even a CLI to get you quick started with springboot. CLI stands for Command Line Interface which gives *spring* command using which","canonical_url":"https:\/\/tothenewco.pro\/blog\/quick-start-with-springboot-using-cli\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/tothenewco.pro\/blog\/quick-start-with-springboot-using-cli\/#article","name":"Quick start with Springboot using CLI | TO THE NEW Blog","headline":"Quick start with Springboot using CLI","author":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/banti-prajapati\/#author"},"publisher":{"@id":"https:\/\/tothenewco.pro\/blog\/#organization"},"datePublished":"2015-07-17T22:04:29+05:30","dateModified":"2015-07-17T22:04:29+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/tothenewco.pro\/blog\/quick-start-with-springboot-using-cli\/#webpage"},"isPartOf":{"@id":"https:\/\/tothenewco.pro\/blog\/quick-start-with-springboot-using-cli\/#webpage"},"articleSection":"Technology"},{"@type":"BreadcrumbList","@id":"https:\/\/tothenewco.pro\/blog\/quick-start-with-springboot-using-cli\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog#listItem","position":1,"name":"Home","item":"https:\/\/tothenewco.pro\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/technology\/#listItem","name":"Technology"}},{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/technology\/#listItem","position":2,"name":"Technology","item":"https:\/\/tothenewco.pro\/blog\/category\/technology\/","nextItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/quick-start-with-springboot-using-cli\/#listItem","name":"Quick start with Springboot using CLI"},"previousItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/quick-start-with-springboot-using-cli\/#listItem","position":3,"name":"Quick start with Springboot using CLI","previousItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/technology\/#listItem","name":"Technology"}}]},{"@type":"Organization","@id":"https:\/\/tothenewco.pro\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/tothenewco.pro\/blog\/"},{"@type":"Person","@id":"https:\/\/tothenewco.pro\/blog\/author\/banti-prajapati\/#author","url":"https:\/\/tothenewco.pro\/blog\/author\/banti-prajapati\/","name":"Vinay Prajapati","image":{"@type":"ImageObject","@id":"https:\/\/tothenewco.pro\/blog\/quick-start-with-springboot-using-cli\/#authorImage","url":"https:\/\/newersworld-sf-static.tothenew.net\/prod\/profilePicFolder\/1e6eb582-cd9f-416a-840d-4ea31be5ee61_vinay.prajapati@tothenew.com.jpg","width":96,"height":96,"caption":"Vinay Prajapati"}},{"@type":"WebPage","@id":"https:\/\/tothenewco.pro\/blog\/quick-start-with-springboot-using-cli\/#webpage","url":"https:\/\/tothenewco.pro\/blog\/quick-start-with-springboot-using-cli\/","name":"Quick start with Springboot using CLI | TO THE NEW Blog","description":"SpringBoot is one of the main projects of Spring community which takes opinionated view of production ready applications. It helps you getting up and running a production grade spring application. It comes with even a CLI to get you quick started with springboot. CLI stands for Command Line Interface which gives *spring* command using which","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/tothenewco.pro\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/tothenewco.pro\/blog\/quick-start-with-springboot-using-cli\/#breadcrumblist"},"author":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/banti-prajapati\/#author"},"creator":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/banti-prajapati\/#author"},"datePublished":"2015-07-17T22:04:29+05:30","dateModified":"2015-07-17T22:04:29+05:30"},{"@type":"WebSite","@id":"https:\/\/tothenewco.pro\/blog\/#website","url":"https:\/\/tothenewco.pro\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/tothenewco.pro\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"article","og:title":"Quick start with Springboot using CLI | TO THE NEW Blog","og:description":"SpringBoot is one of the main projects of Spring community which takes opinionated view of production ready applications. It helps you getting up and running a production grade spring application. It comes with even a CLI to get you quick started with springboot. CLI stands for Command Line Interface which gives *spring* command using which","og:url":"https:\/\/tothenewco.pro\/blog\/quick-start-with-springboot-using-cli\/","og:image":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","article:tag":["technology"],"article:published_time":"2015-07-17T16:34:29+00:00","article:modified_time":"2015-07-17T16:34:29+00:00","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Quick start with Springboot using CLI | TO THE NEW Blog","twitter:description":"SpringBoot is one of the main projects of Spring community which takes opinionated view of production ready applications. It helps you getting up and running a production grade spring application. It comes with even a CLI to get you quick started with springboot. CLI stands for Command Line Interface which gives *spring* command using which","twitter:image":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"22132","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":"","og_description":"","og_object_type":"article","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":"","og_article_tags":"","twitter_use_og":false,"twitter_card":"summary","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-30 02:52:36","updated":"2024-02-29 08:58:08","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/tothenewco.pro\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/tothenewco.pro\/blog\/category\/technology\/\" title=\"Technology\">Technology<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tQuick start with Springboot using CLI\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/tothenewco.pro\/blog"},{"label":"Technology","link":"https:\/\/tothenewco.pro\/blog\/category\/technology\/"},{"label":"Quick start with Springboot using CLI","link":"https:\/\/tothenewco.pro\/blog\/quick-start-with-springboot-using-cli\/"}],"_links":{"self":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts\/22132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/users\/119"}],"replies":[{"embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/comments?post=22132"}],"version-history":[{"count":0,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts\/22132\/revisions"}],"wp:attachment":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/media?parent=22132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/categories?post=22132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/tags?post=22132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}