spring - 使用 curl 获取 Spring Initializr 的所有依赖项列表
问题描述
在官方文档中,它讲述了如何使用curl
来创建一个 spring 项目。
例如,
curl https://start.spring.io/starter.zip -d dependencies=web,devtools \
-d bootVersion=2.1.9.RELEASE -o my-project.zip
我的问题是,我如何使用curl
来获取所有依赖项的列表?
输出应该如下所示
# output of `curl ...` to get all dependencies of Spring Initializr
...
web
devtools
...
解决方案
也许为时已晚,您不再需要,但可以对其他人有所帮助...
有一个 url 可以检索相关信息,例如版本、选项和依赖项。
curl -H 'Accept: application/json' https://start.spring.io
如果您只想过滤依赖项的名称,在jq帮助下,您可以使用以下命令请求:
curl -H 'Accept: application/json' https://start.spring.io | jq '.dependencies.values[].values[].id'
结果是这样的:
"devtools"
"lombok"
"configuration-processor"
"web"
"webflux"
"data-rest"
"session"
"data-rest-explorer"
"data-rest-hal"
...
推荐阅读
- r - 如何在R中选择重复多年的特定日期范围?
- flutter - Flutter:找不到 ScaffoldMessenger 小部件
- android - 反应原生导航延迟
- django - Django:“扩展”在模板中不起作用
- python - 如何从 Python 中的 span 标签中获取文本
- go - 当 SIGTERM 触发时停止 main.go
- database - 是否可以将单个 PostgreSQL 数据库存储在单个文件/目录中,而不是存储在单个中央数据存储库中?
- python - NameError:名称“块”未定义
- angular - Angular 应用程序的后台 Http 调用
- ms-access - 如何在 Access 查询中计算表中的特定值