JHipster学习记录 - 0 安装

漆雕宏浚
2023-12-01

JHipster介绍

官网:https://www.jhipster.tech/
官方教程:https://github.com/mraible/jhipster6-demo

JHipster是一个开发平台,用于生成,开发和部署 Spring Boot + Angular / React / Vue Web应用程序和Spring微服务。目标是为生成一个完整的现代Web应用程序或微服务架构
JHipster is a development platform to quickly generate, develop, and deploy modern web applications and microservice architectures. We support many frontend technologies, including Angular, React, and Vue. We even have mobile app support for Ionic and React Native! On the backend, we support Spring Boot (with Java or Kotlin), Micronaut, Quarkus, Node.js, and .NET. For deployment, we embrace cloud native principles with Docker and Kubernetes. Deployment support exists for AWS, Azure, Cloud Foundry, Google Cloud Platform, Heroku, and OpenShift.

我自己的理解:
JHipster是一个开发的脚手架,使用它可以非常快速的自动生成前后台完备的微服务项目。
对于JAVA来说,spring boot类似于把spring里繁琐的配置都提供了一个默认值,极大的减少的了配置文件的数量
而JHipster则是更进一步,它直接把整个微服务要用的mvn依赖,spring配置文件以及一大堆乱七八糟的类都根据最佳实践自动生成了,这样节省了大量自己写配置文件和配置类的时间

  • 使用JHipster前:新建springboot项目 --> 引入mvn依赖 --> 配置application.yml文件 --> 写configuration类 --> 其它操作
  • 使用JHipster后:一键生成

JHipster优缺点及使用场景

以下仅代表个人观点:

  • 优点:开箱即用,一键生成整个项目雏形,不用花时间去加依赖,写配置文件

  • 缺点:东西太太太多了!如果对于JHipster里集成的那些技术和框架不熟悉,就会有一大堆看不懂也不知道干啥用也可能用不到的文件,不知道有没有用也不敢删

  • 使用场景:如果是要新建一个微服务项目,使用JHipster是非常不错的。但是如果仅仅是在微服务项目里添加一个子模块,我认为不是很适合,还是老实用spring boot starter

JHipster下载安装

  1. Install JHipster npm install -g generator-jhipster
  2. Create a new directory and go into it mkdir myApp && cd myApp
  3. Run JHipster and follow instructions on screen jhipster

官方的教程假设用户已经安装了JAVA,GIT和NODE.JS

  1. npm install -g generator-jhipster
  2. 新建一个目录,比如叫 myApp , 进入这个目录
  3. 运行 HJipster
  4. 这时会有一个问答式的环境,比如问你要用哪个数据库,你只要根据他的提示回答就行,当所有的问答都完成后,就会在当前目录自动创建一个项目了
 类似资料: