jhipster 介紹

一、Jhipster介紹

大神語錄:一個代碼生成器而已,核心是Spring Boot、spring.
用於生成,開發和部署 Spring Boot + Angular / React / Vue Web應用程序和Spring微服務。

二、創建第一個jhipster應用

1.準備工作

安裝JDK,注意版本(我初次使用的是1.8,並且需要配置環境變量)
安裝數據庫(我安裝的是mysql)
安裝Maven
安裝git
安裝node.js
安裝Yeoman

npm install -g yo

安裝bower

npm install -g bower

安裝Grunt

npm install -g grunt-cli

安裝jhipster

npm install -g generator-jhipster

2.開始創建jhipster應用

打開命令行窗口,進入要創建的項目所對應的空文件夾(testjhipster)。輸入命令:

> yo jhipster

接着出現交互問答,以便按照開發者要求去生成代碼,實現應用的功能:

What is the base name of your application?#項目的基本名稱,輸入默認的testjhipster。回車。
testjhipster
What is your default Java package name?#項目中默認的java包的包名。我輸入:com.mytest.testjhipster。回車
com.mytest.testjhipster
Which type of authentication would you like to use?#使用哪種類型的驗證。這個暫時不明白,沒關係,通過上下箭頭選擇,我們選擇默認的。回車。
Which type of database would you like to use?#使用什麼類型的數據庫?有三個選項:SQL、MongoDB、Cassandra。MongoDB是分佈式文檔存儲數據庫,Cassandra是開源分佈式NoSQL數據庫類型。我們選擇常用的關係數據庫類型SQL。回車。
Which production database would you like to use?#使用什麼具體的數據庫產品?我們選擇默認的MySQL。回車。這個選擇與項目生成後的src/main/resources/config/application-prod.yml文件密切相關。
which development database would you like to use?#開發時使用什麼數據庫?這裏有三個選項,'H2 with disk-based persistence'、'H2 with in-memory persistence'和'MySQL',第一個是將數據保存在運行內存中,重啓服務器時,數據就會丟失。第二個是將數據保存在磁盤中,目前正在測試階段,而且不能再window下正常使用。我們選擇默認的MySQL。這個選擇對應項目生成後的src/main/resources/config/application-dev.yml文件。回車。
Do you want to use Hibernate 2nd level cache?#是否需要使用Hibernate二級緩存?根據自己需要,項目只是用來測試,因此我們選擇NO。回車。
Do you want to use a search engine in your application?#是否需要使用一個搜索引擎。這個搜索引擎可以搜到關於jhipster的相關指南。我們選擇默認的No。回車。
Do you want to use clustered HTTP sessions?#是否使用集羣HTTP回話,不懂,沒關係,選擇默認的NO。回車。
Do you want to use WebSocket?是否使用websocket?#不明白websocket的作用和用法。因此選擇默認的No。回車。
Would you like to use Maven or Gradle for building the backend?#使用Maven或者Gradle。我們選擇默認的Maven。回車
Would you like to use Grunt or Gulp.js for building the frontend?#使用默認的Grunt。回車。
Would you like to use the LibSass stylesheet preprocessor for your css?#是否使用LibSass作爲css樣式表處理器。我們輸入NO。回車
Would you like to enable translation support with Angular Translate?#是否使用Anjular提供的翻譯支持?我們選擇No。回車。
Which testing frameworks would you like to use?#測試框架的選擇。我們選擇默認,直接回車。

問題回答完畢,然後等待。直到結束,基本的jhipster項目testjhipster創建完畢。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章