Spring Boot CLI Simple to use

Source: Internet
Author: User
Tags versions spring initializr
Spring Boot CLI

Springboot provides a console command tool that can be used to quickly build a spring-based prototype. It supports running groovy scripts, which means you can use Java-like syntax, but you don't have to write a lot of template code.
Download Address:
https://repo.spring.io/release/org/springframework/boot/spring-boot-cli/1.4.7.RELEASE/ Spring-boot-cli-1.4.7.release-bin.zip

https://repo.spring.io/release/org/springframework/boot/spring-boot-cli/1.4.7.RELEASE/ spring-boot-cli-1.4.7.release-bin.tar.gz download and unzip. The directory has a install.txt, there are some simple installation instructions, set environment variables, add ... \spring-1.4.7.release\bin the path. Entering spring–version on the command line displays the relevant version number, stating that the installation is complete.
The overall process of installation:
Download--"Configure environment variables (xxx/bin)--" complete

If you are using a UNIX machine you can try the Software Development Kit Sdkman (software Development Kit Manager), which can be used to install and manage multiple versions of the spring Boot CLI, Web site address http://sdkman.io/ Not much to say, is interested in can give it a try.
Some of the following commands:

Install Sdkman
$curl-S Get.sdkman.io|bash
$source "/root/.sdkman/bin/sdkman-init.sh"
------------------- --------
//Install the Springboot CLI
$sdk install springboot
$spring-version
//Find available versions
$SDK list Springboot CLI
//Install the specified version of the Springboot CLI
$sdk install springboot 1.4.7.RELEASE
//switch version
$SDK use Springboot 1.4.7.RELEASE
//Set default version
$SDK defaults springboot 1.4.7.RELEASE

Spring Initializr (essentially a Web application that generates a SPRINGBOOT project structure)
Spring Initializr is used in the following ways: through the Web interface. https://start.spring.io/is available through Spring Tool Suite. Used by IntelliJ idea. Used by the spring Boot CLI.

The following Springboot project is generated using spring INITIALIZR with SPRINGBOOTCLI
The simplest application can be generated with the following command

Spring Init

See how to set parameters with spring Help init

Spring Init-initialize a new project using Spring Initializr (start.spring.io) usage:spring init [options] [location] O Ption Description------------------A,--artifactid Project coordinates;             Infer Archive name (for example ' test ')-B,--boot-version Spring boot version (for example ' 1.2.0.RELEASE ')--build  Build system to use (for example ' maven ' or ' Gradle ') (Default:maven)-D,--dependencies comma-separated list of Dependency identifiers to include in the generated project--description project Description- F,--force Force overwrite of existing files--format format of the generated content (for example ' bui LD ' For a build file, ' project ' for a Project Archive) (Default:project)-G,--groupid Projec T coordinates (for example ' org.test ')-j,--java-version Language level (for example ' 1.8 ')-L,--language Programm ing language (for example ' Java ')-N,--nAme Project name; Infer application name-p,--packaging Project packaging (for example ' jar ")--package-name package name-t,--ty PE Project type.
                      Not normally needed if your use--build and/or--format.
                      Check the capabilities of the service (--list) for more details--target URLs of the service to use (default: Https://start.spring.io)-V,--version Project version (for example ' 0.0.1-snapshot ')-X,--EXTR Act Extract the Project archive. Inferred if a location was specified without an extension examples:to list all the capabilities Of the service: $ spring init--list to creates a default project: $ spring init to create a web m Y-app.zip: $ spring init-d=web my-app.zip to create a WEB/DATA-JPA Gradle Project unpacked: $ spring INIT-D=WEB,JPA--build=gradle My-dir

Example: initialize a maven,java version of 1.8, add dependent Web, JPA, security, Springboot version 1.4.7.RELEASE, package named Com.test, package the jar package known as MyApp, Artifactid to Helloboot, version 0.0.1-snapshot

Spring init--build maven-j 1.8-dweb,jpa,security-b 1.4.7.release-g com.test-p jar myapp-a helloboot-v 0.0.1-SNAPSH OT

Once the project is built successfully, a folder named MyApp is generated in the current directory, which is the generated project.

It is common for us to build our project using idea in development, without the need to use the spring Boot CLI to be interested in trying.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.