This is continuation to my two previous posts. Before reading this post, please go through my previous posts at “Spring Boot Initilizr Web Interface” , “Spring Boot Initilizr With IDEs or IDE Plugins” and “Spring Boot Initilizr With Spring Boot CLI”.

这是我之前两篇文章的延续。 在阅读本文之前,请仔细阅读我以前的文章:“ Spring Boot Initilizr Web界面 ”, “带有IDE或IDE插件的 Spring Boot Initilizr ”和“带有Spring Boot CLI的Spring Boot Initilizr” 。

Spring Boot Initilizr is used to quick start new Spring Boot Maven/Gradle projects within no time. It generates initial project structure and build scripts to reduce Development time.

Spring Boot Initilizr用于快速启动新的Spring Boot Maven / Gradle项目。 它生成初始项目结构并构建脚本以减少开发时间。

As we discussed in my previous post, Spring Boot Initilizr is available in the following forms:

正如我们在上一篇文章中讨论的那样,Spring Boot Initilizr具有以下形式:

  1. Spring Boot Initilizr With Web Interface具有Web界面的Spring Boot Initilizr
  2. Spring Boot Initilizr With IDEs/IDE Plugins具有IDE / IDE插件的Spring Boot Initilizr
  3. Spring Boot Initilizr With Spring Boot CLI使用Spring Boot CLI的Spring Boot Initilizr
  4. Spring Boot Initilizr With ThirdParty Tools带有第三方工具的Spring Boot Initilizr

Now we are going to discuss on “How to use some popular Third Party Tools to bootstrap Spring Applications” using “Spring Boot Initilizr With ThirdParty Tools” option.

现在,我们将讨论“如何使用带有第三方工具的Spring Boot Initilizr”选项“如何使用一些流行的第三方工具来引导Spring应用程序”。

带有第三方工具的Spring Boot Initilizr (Spring Boot Initilizr With ThirdParty Tools)

We can also use the following third party tools to bootstrap Spring Boot Applications.

我们还可以使用以下第三方工具来引导Spring Boot应用程序。

  1. CURL ToolCURL工具
  2. HTTPie ToolHTTPie工具

We will discuss these tools one by one with some simple examples in the following sections.

在以下各节中,我们将通过一些简单的示例逐一讨论这些工具。

带“ curl”工具的Spring Boot示例 (Spring Boot Example with “curl” Tool)

“curl” is an open source library and command-line tool for transferring data using various protocols like FTP,FTPS,HTTP,HTTPS,SMTP,POP3,LDAP etc. We can also use this tool to bootstrap our Spring Boot applications very easily.

“ curl”是一个开源库和命令行工具,用于使用各种协议(例如FTP,FTPS,HTTP,HTTPS,SMTP,POP3,LDAP等)传输数据。我们还可以使用此工具非常轻松地引导我们的Spring Boot应用程序。

“curl” official website is available at : https://curl.haxx.se/

“ curl”官方网站位于:https://curl.haxx.se/

“curl” provides two projects:

“ curl”提供了两个项目:

  1. cURL Project – command line toolcURL Project –命令行工具
  2. libcurl Project- librarylibcurl项目库

“cURL” Tool setup
Please access the “https://curl.haxx.se/download.html” URL to download “cURL” Tool.

“ cURL”工具设置
请访问“ https://curl.haxx.se/download.html”URL以下载“ cURL”工具。

I have downloaded Windows 64Bit zip file as shown below

我已经下载了Windows 64Bit zip文件,如下所示

Once download is completed, We will get a zip file as shown below. Just extract this zip file to get “curl.exe” file.

下载完成后,我们将获得如下所示的zip文件。 只需解压缩该zip文件即可获取“ curl.exe”文件。

In Windows, we need to set this System Variable:

在Windows中,我们需要设置以下系统变量:

PATH=D:\SpringBoot;%PATH%

Here “D:\SpringBoot” is my local filesystem path where “curl.exe” command is available.

这里的“ D:\ SpringBoot”是我的本地文件系统路径,其中“ curl.exe”命令可用。

“cURL” Syntax:
We need to follow the following syntax to create our Spring Boot Applications.

“ cURL”语法:
我们需要遵循以下语法来创建我们的Spring Boot Applications。

curl [options...] <url>

We can get all available options by executing “curl –help” command. to bootstrap a Spring Boot Application is Spring Initializr URL:: https://start.spring.io.

通过执行“ curl –help”命令,我们可以获得所有可用的选项。 引导Spring Boot应用程序是Spring Initializr URL :: https://start.spring.io。

When we execute “curl start.spring.io” at CMD Prompt, we can see all available Parameters, List of Spring Boot “dependencies” or “capabilities” etc.

当我们在CMD Prompt上执行“ curl start.spring.io”时,我们可以看到所有可用的参数,Spring Boot“依赖项”或“功能”列表等。

“cURL” Examples:

“ cURL”示例:

Example-1:- To create a Default Spring Boot Project

示例1:-创建默认的Spring Boot项目

curl https://start.spring.io/starter.zip -o SpringBootCurlDefaultProject.zip

It creates a Default Spring Boot project with “SpringBootCurlDefaultProject.zip” name for Maven build tool in current working directory as shown below:

它为当前工作目录中的Maven构建工具创建一个名称为“ SpringBootCurlDefaultProject.zip”的默认Spring Boot项目,如下所示:

Example-2:- To create a Spring Boot Project with required “dependencies” and required packaging type for Gradle build tool

示例2:-使用Gradle构建工具创建具有必需的“依赖关系”和必需的包装类型的Spring Boot项目

curl https://start.spring.io/starter.zip -d dependencies=web,data-jpa,jms,ws-d packaging=war -d type=gradle-project-o SpringBootCurlWebProject.zip

Here we use “-d” option specify parameters.

这里我们使用“ -d”选项指定参数。

“-d type=gradle-project” means creates a Gradle project. Same way we can specify for Maven Project: “-d type=maven-project” (It is default value for “type” parameter).

“ -d type = gradle-project”表示创建Gradle项目。 我们可以为Maven项目指定的方法相同:“ -d type = maven-project”(这是“ type”参数的默认值)。

Example-3:- To create a Spring Boot Project with required “dependencies” and required packaging type for Maven build tool

示例3:-创建一个具有所需“依赖项”和所需Maven构建工具的打包类型的Spring Boot项目

curl https://start.spring.io/starter.zip -d dependencies=web,jdbc,ws,cloud-aws,h2 -d packaging=war -d type=maven-project-o SpringBootCurlWebMavenProject.zip

Here we use “-d” option specify parameters.

这里我们使用“ -d”选项指定参数。

“-d type=gradle-project” means creates a Gradle project. “type=maven-project” to create a Maven Project with pom.xml file(It is default value for “type” parameter).

“ -d type = gradle-project”表示创建Gradle项目。 “ type = maven-project”使用pom.xml文件创建Maven项目(这是“ type”参数的默认值)。

It creates Mavenized project with Spring MVC,Spring JDBC,Spring WS,Spring Cloud with AWS, H2 Database capabilities.

它使用Spring MVC,Spring JDBC,Spring WS,具有AWS和H2数据库功能的Spring Cloud创建Mavenized项目。

Example-4:- To create a Spring Boot Project with required “dependencies” and required packaging type for Gradle build tool by specifying Java and Spring Boot Framework version.

示例4:-通过指定Java和Spring Boot Framework版本,为Gradle构建工具创建具有必需的“依赖关系”和必需的包装类型的Spring Boot项目。

By default, “spring init” command will pickup “System Variables” and take appropriate Spring Boot and Java Versions. However it is possible to specify Spring Boot and Java Versions.

默认情况下,“ spring init”命令将提取“系统变量”并采用适当的Spring Boot和Java版本。 但是,可以指定Spring Boot和Java版本。

My Windows system is configured with Java Version = 1.8 and Spring Boot version = 1.2.3.RELEASE. However I would like to change them in creating new Spring Boot project as shown below.

我的Windows系统配置了Java版本= 1.8和Spring Boot版本= 1.2.3.RELEASE。 但是我想在创建新的Spring Boot项目时更改它们,如下所示。

curl https://start.spring.io/starter.zip -d dependencies=web,jdbc,ws,cloud-aws,h2 -d packaging=war -d type=gradle-project-d javaVersion=1.7-d bootVersion=1.2.5.RELEASE-o SpringBootCurlWebGradleProject.zip

Here we use “-d” option specify parameters.

这里我们使用“ -d”选项指定参数。

  • “-d javaVersion=1.7” option is used to specify Java Version like 1.7,1.8 etc.“ -d javaVersion = 1.7”选项用于指定Java版本,例如1.7、1.8等。
  • “-d bootVersion=1.2.5.RELEASE” option is used to specify Spring Boot Framework version like 1.2.5,1.3 etc.“ -d bootVersion = 1.2.5.RELEASE”选项用于指定Spring Boot Framework版本,例如1.2.5、1.3等。
  • “-d type=gradle-project” means creates a Gradle project.“ -d type = gradle-project”表示创建Gradle项目。
  • “type=maven-project” to create a Maven Project with pom.xml file(It is default value for “type” parameter).“ type = maven-project”使用pom.xml文件创建Maven项目(这是“ type”参数的默认值)。
  • “-d dependencies=web,jdbc,ws,cloud-aws,h2” specifies our Project Capabilities.“ -d依赖性= web,jdbc,ws,cloud-aws,h2”指定我们的项目功能。
  • “-d packaging=war” option specifies the packaging type is “war”. Default value is “jar”. It accepts “pom, jar, war, ear, rar, par”“ -d packaging = war”选项指定包装类型为“ war”。 默认值为“ jar”。 它接受“ pom,jar,war,ear,rar,par”

It creates Mavenized project with Spring MVC,Spring JDBC,Spring WS,Spring Cloud with AWS, H2 Database capabilities and uses Java Varsion = 1.7 and Spring Boot Framework version = 1.2.5.RELEASE.

它使用Spring MVC,Spring JDBC,Spring WS,具有AWS的Spring Cloud,H2数据库功能创建Mavenized项目,并使用Java Varsion = 1.7和Spring Boot Framework版本= 1.2.5.RELEASE。

That’s it about “curl” tool to bootstrap a Spring Boot Applications with simple commands. We can import those projects into our Spring IDEs and can enhance them as per our project requirements.

这就是关于使用简单命令来引导Spring Boot应用程序的“ curl”工具的信息。 我们可以将那些项目导入到我们的Spring IDE中,并可以根据我们的项目要求对其进行增强。

NOTE:-

注意:-

WE can refer to know the list of supported identifiers for the comma-separated list of “dependencies” at “Spring Boot Initilizr With Spring Boot CLI”.

我们可以在“使用Spring Boot CLI的Spring Boot Initilizr ”中以逗号分隔的“依赖项”列表参考支持的标识符列表。

The following section has a list of supported build options.

以下部分列出了受支持的构建选项。

+-----------------+-----------------------------------------+
| Rel             | Description                             |
+-----------------+-----------------------------------------+
| gradle-build    | Generate a Gradle build file            |
| gradle-project  | Generate a Gradle based project archive |
| maven-build     | Generate a Maven pom.xml                |
| maven-project * | Generate a Maven based project archive  |
+-----------------+-----------------------------------------+

Default build parameter value is “maven-project”

默认的构建参数值为“ maven-project”

The URI templates take a set of parameters to customize the result of a request to the linked resource..

URI模板采用一组参数来定制对链接资源的请求结果。

+-----------------+------------------------------------------+------------------------------+
| Parameter       | Description                              | Default value                |
+-----------------+------------------------------------------+------------------------------+
| applicationName | application name                         | DemoApplication              |
| artifactId      | project coordinates (infer archive name) | demo                         |
| baseDir         | base directory to create in the archive  | no base dir                  |
| bootVersion     | spring boot version                      | 1.2.5.RELEASE                |
| dependencies    | dependency identifiers (comma-separated) | none                         |
| description     | project description                      | Demo project for Spring Boot |
| groupId         | project coordinates                      | org.test                     |
| javaVersion     | language level                           | 1.8                          |
| language        | programming language                     | java                         |
| name            | project name (infer application name)    | demo                         |
| packageName     | root package                             | demo                         |
| packaging       | project packaging                        | jar                          |
| type            | project type                             | maven-project                |
| version         | project version                          | 0.0.1-SNAPSHOT               |
+-----------------+------------------------------------------+------------------------------+

使用“ HTTPie”工具的Spring Boot示例 (Spring Boot Example with “HTTPie” Tool)

Like CURL tool, HTTPie is a command line HTTP client to bootstrap a Spring Boot applications with simple commands. It is a human-friendly JSON based tool. It is mainly used for testing, debugging and interacting with HTTP Web Services or Web Servers.

像CURL工具一样,HTTPie是一个命令行HTTP客户端,用于使用简单命令来引导Spring Boot应用程序。 这是一个基于JSON的人性化工具。 它主要用于测试,调试和与HTTP Web服务或Web服务器交互。

Httpie official website: https://github.com/jkbrzt/httpie

Httpie官方网站:https://github.com/jkbrzt/httpie

“HTTPie” Tool Setup

“ HTTPie”工具设置

  1. Download latest Python Windows Installer from “https://www.python.org/downloads/” and install it.从“ https://www.python.org/downloads/”下载最新的Python Windows Installer并进行安装。
  2. I have installed Python 2.7 as shown below. Installation is very easy with zip file. If you use Windows Installer then just follow default settings to install it.

    我已经安装了Python 2.7,如下所示。 使用zip文件安装非常容易。 如果您使用Windows Installer,则只需按照默认设置进行安装即可。

  3. Download “get-pip.py” from “https://pip.pypa.io/en/latest/installing.html#install-pip”从“ https://pip.pypa.io/en/latest/installing.html#install-pip”下载“ get-pip.py”
  4. Just Mouse right click and save as to your required filesystem path:

    只需鼠标右键单击并另存为所需的文件系统路径:

  5. Install “pip” by using the following command使用以下命令安装“ pip”
  6. python get-pip.py
  7. Install “httpie” tool by using the following command使用以下命令安装“ httpie”工具
  8. python -m pip install --upgrade httpie

“HTTPie” Examples

“ HTTPie”示例

Example-1:- To create a Default Spring Boot Project

示例1:-创建默认的Spring Boot项目

python -m httpie https://start.spring.io/starter.zip -d

It creates a new Spring Boot Project with default settings like: create project filename is “demo.zip”, Build tool is “Maven”. It takes default Java Version and Spring Boot Framework version from System Variables.

它使用默认设置创建一个新的Spring Boot项目,例如:创建项目文件名为“ demo.zip”,构建工具为“ Maven”。 它从系统变量中获取默认的Java版本和Spring Boot Framework版本。

Example-2:- To create a Spring Boot WebAppilcation(war) Project With required dependencies for Gradle build tool

示例2:-创建带有Gradle构建工具所需依赖项的Spring Boot WebAppilcation(war)项目

python -m httpie https://start.spring.io/starter.zip dependencies==web,data-jpa,jms,wstype==gradle-projectpackaging==war-d

It creates a Gradle project with Spring MVC,Spring DATA JPA,Spring JMS,Spring WS Capabilities.

它使用Spring MVC,Spring DATA JPA,Spring JMS,Spring WS Capabilities创建一个Gradle项目。

NOTE:-Here we should observe that we need to use double equal symbols like “==” between parameter or option names and values.

注意:-在这里我们应该注意到,我们需要在参数或选项名称与值之间使用双等号,例如“ ==”。

We can refer “Curl tool” section to know the list of supported “dependencies”, “parameters” and build tool options. Both HTTPIE and Curl tools share same options and parameters.

我们可以参考“卷曲工具”部分来了解支持的“依赖关系”,“参数”和构建工具选项的列表。 HTTPIE和Curl工具共享相同的选项和参数。

That’s it all about “Spring Boot Initilizr With Thard Party Tools”.

关于“带有Thard Party Tools的Spring Boot Initilizr”的全部内容。

Please drop me a comment if you face any issues or have any suggestions.

如果您遇到任何问题或有任何建议,请给我评论。

翻译自: https://www.journaldev.com/8650/spring-boot-initilizr-with-thirdparty-tools

带有第三方工具的Spring Boot Initilizr相关推荐

  1. 使用Spring Boot CLI的Spring Boot Initilizr

    This is continuation to my two previous posts. Before reading this post, please go through my previo ...

  2. 具有IDE或IDE插件的Spring Boot Initilizr

    This is continuation to my previous post. Before reading this post, please go through my previous po ...

  3. Spring Boot Initilizr - 使用ThirdParty工具

    Spring Boot Initilizr - 使用ThirdParty工具 这是我之前的两篇文章的延续.在阅读本文之前,请先阅读我之前在" Spring Boot Initilizr We ...

  4. Spring Boot Initilizr Web界面

    Spring Boot Initilizr Web界面 在这篇文章中,我们将讨论Spring Boot Initilizr Web Interface及其IDE或IDE插件.在阅读帖子之前,请查看我之 ...

  5. Spring Boot Initilizr - 使用Spring Boot CLI

    Spring Boot Initilizr - 使用Spring Boot CLI 这是我之前的两篇文章的延续.在阅读本文之前,请先阅读我之前在" Spring Boot Initilizr ...

  6. Spring Boot Initilizr - 使用IDE或IDE插件

    Spring Boot Initilizr 使用IDE或IDE插件 这是我之前的帖子的延续.在阅读这篇文章之前,请先阅读我在" Spring Boot Initilizr Web界面 &qu ...

  7. 测开工具:spring boot 实现mock平台

    目录 一.实现功能 1.使用spring boot 实现mock平台 2.返回结果数据的存放: 3.如何根据url返回对应的结果? 1.3.1  将请求的URI拼成返回结果的文件/文件夹路径 1.3. ...

  8. 【星云测试】开发者测试-采用精准测试工具对Spring Boot应用进行测试

    2019独角兽企业重金招聘Python工程师标准>>> 简介:本文主要介绍把现今主流的springboot框架项目和精准测试工具进行结合和应用,通过精准测试的数据穿透.数据采集.测试 ...

  9. compose应用_带有PostgreSQLDocker Compose for Spring Boot应用程序

    compose应用 在此博客文章中,您将学习如何使用PostgreSQL配置Spring Boot应用程序以与Docker Compose一起运行. 这篇博客文章涵盖: Spring Boot应用程序 ...

最新文章

  1. 干货 | 为你解读34篇ACL论文
  2. 常用的函数式接口_Consumer接口
  3. 【安卓开发 】Android初级开发(十)Android中app自动更新版本号比较
  4. 组件化与插件化的差别在哪里?附面试题答案
  5. ADF12C+GLASSFISH4.1配置数据源
  6. axios请求跨域前端解决_Vue-创建axios实例并实现跨域请求(完整过程-前端)
  7. Java生成二维码QRCode(亲测可通过扫码枪扫出)
  8. php 解压 中文文件夹,如何把文件夹压缩为rar
  9. excel画boxplot的q1和q3值和excel公式QUARTILE.INC(array,quart)拉出来的不一样
  10. 使用Foxmail定制自己的邮件模板
  11. 联想小新air13pro重装系统_联想小新Air 13怎么装win10系统|联想小新Air 13用u盘重装win10系统教程-系统城...
  12. 阅读笔记之《DisenQNet: Disentangled Representation Learning for Educational Questions》
  13. fread函数和fwrite函数的用法
  14. 紫薇圣人的程序员人生[原创IT小说]
  15. 技术宅男买房记之建筑日照采光计算
  16. android电话遥控+android盒子,玩转Android盒子,空中鼠标才是绝配
  17. 如何利用边缘计算,实现低延时、高质量的互动课堂体验?
  18. 【水花的2021年度总结】
  19. 刘馨蔓:“她是行走的发光体”|OneFlow U
  20. 计算机的硬件组成(详)

热门文章

  1. 深入理解Javascript之this关键字
  2. 从华为“流程与IT管理部”看IT部门定位
  3. 关于div布局中float的使用
  4. [转载] numpy.bincount介绍以及巧妙计算分类结果中每一类预测正确的个数
  5. 路由算法之LS算法和DV算法全面分析
  6. Django rest framework 序列化组件
  7. vue-resource中文文档
  8. java取得当前日期增加一天或多天
  9. 取消冒泡的兼容性写法
  10. 【转载】SpringMVC访问静态资源