创建综合应用
mkdir jhipster\app
cd jhipster\app
yo jhipster
? (1/15) Which *type* of application would you like to create? (Use arrow keys) //选择创建的应用类型
> Monolithic application (recommended for simple projects) //综合应用
Microservice application //微服务应用
Microservice gateway //微服务网关
[BETA] JHipster UAA server (for microservice OAuth2 authentication) //微服务OAuth2的身份认证服务
? (2/15) Which *Framework* would you like to use for the client? //选择AngularJS 版本
AngularJS 1.x
> [BETA] Angular 2.x
? (3/15) What is the base name of your application? (app) //服务名
? (4/15) Would you like to install other generators from the JHipster Marketplace? No //从JHipster Marketplace 安装其他生成器
? (5/15) What is your default Java package name? (com.shunneng.app) //默认包名
? (6/15) Which *type* of authentication would you like to use? (Use arrow keys) //选择认证方式
> HTTP Session Authentication (stateful, default Spring Security mechanism) //Spring Security默认机制 基于HTTP会话的认证方式(带状态)
OAuth2 Authentication (stateless, with an OAuth2 server implementation) //OAuth2的认证实现(无状态)
JWT authentication (stateless, with a token) //J(son)W(eb)T(oken)(无状态)
? (7/15) Which *type* of database would you like to use? (Use arrow keys) //选择数据库类型
> SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle) //关系型数据库
MongoDB //NoSQL
Cassandra //NoSQL
? (8/15) Which *production* database would you like to use? (Use arrow keys) //生产数据库
> MySQL
MariaDB
PostgreSQL
Oracle - Warning! The Oracle JDBC driver (ojdbc) is not bundled because it is not Open Source. Please follow our documentation to instal l it manually.
Microsoft SQL Server
? (9/15) Which *development* database would you like to use? (Use arrow keys) //开发数据库
> H2 with disk-based persistence //数据存储在磁盘的H2
H2 with in-memory persistence //内存H2(服务关闭数据丢失)
MySQL
? (10/15) Do you want to use Hibernate 2nd level cache? (Use arrow keys) //Hibernate 二级缓存
No
> Yes, with ehcache (local cache, for a single node) //本地缓存方案 ehcache
Yes, with HazelCast (distributed cache, for multiple nodes) //集群缓存方案,多节点缓存,适合多微服务的分布式环境
? (11/15) Would you like to use Maven or Gradle for building the backend? (Use arrow keys) //选择后台构建系统
> Maven //更成熟,稳定,用户群体更大
Gradle //更灵活,易于扩展,支持maven一键转Gradle
? (12/15) Which other technologies would you like to use? (Press <space> to select) //可选技术
>( ) Social login (Google, Facebook, Twitter) //第三方社交登录,基于OAuth2.0
( ) Search engine using ElasticSearch //集成搜索开源搜索引擎 ElasticSearch
( ) Clustered HTTP sessions using Hazelcast //使用Hazelcast管理http session集群
( ) WebSockets using Spring Websocket //使用Spring Websocket
( ) [BETA] Asynchronous messages using Apache Kafka //Apache Kafka 是一种高吞吐量的分布式发布订阅消息系统
? (13/15) Would you like to use the LibSass stylesheet preprocessor for your CSS? (y/N) //建议使用gulp定时构建,将sass转换成css而不是运行时处理
? (14/15) Would you like to enable internationalization support? (Y/n) //是否使用国际化
? Please choose the native language of the application? (Use arrow keys) //选择本地化语言
Catalan
> Chinese (Simplified) //中文简体
Chinese (Traditional)
Czech
Danish
Dutch
English
(Move up and down to reveal more choices)
? Please choose additional languages to install (Press <space> to select)//选择其余支持语言
>( ) Catalan
( ) Chinese (Traditional)
( ) Czech
( ) Danish
( ) Dutch
( ) English
( ) French
(Move up and down to reveal more choices)
? (15/15) Which testing frameworks would you like to use? (Press <space> to select) //默认情况下 JHipster 提供 java 单元/集成测试(使用Spring JUnit支持)和 JavaScript 单元测试(使用Karma.js)。这也是一个可选项。
>( ) Gatling //使用 Gatling 进行性能测试。
( ) Cucumber //使用 Cucumber 模拟用户行为
( ) Protractor //使用 Protractor 对 AngularJS 进行集成测试
第一次创建比较慢,后边如果要创建综合应用或者微服务网关应用,可以将 node_modules
复制到其目录下面,参考加快构建jhipster-generator-jhipster
创建微服务身份认证中心UAA
mkdir uaa
cd uaa
yo jhipster
? (1/15) Which *type* of application would you like to create?
Monolithic application (recommended for simple projects)
Microservice application
Microservice gateway
> [BETA] JHipster UAA server (for microservice OAuth2 authentication)
? (2/13) What is the base name of your application? uaa
? (3/15) Would you like to install other generators from the JHipster Marketplace? (y/N)
? (4/15) As you are running in a microservice architecture, on which port would like your server to run? It should be unique to avoid port conflicts. (9999)
? (5/15) What is your default Java package name? (com.shunneng.gateway) com.shunneng.uaa
? (6/15) Which Service Discovery and Configuration solution would you like to use? (Use arrow keys)
> JHipster Registry (using Eureka and Spring Cloud Config)
[BETA] Consul (using Spring Cloud Consul)
No Service Discovery and Configuration
? (7/15) Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle)
? (8/15) Which *production* database would you like to use? (Use arrow keys)
> MySQL
MariaDB
PostgreSQL
Oracle - Warning! The Oracle JDBC driver (ojdbc) is not bundled because it is not Open Source. Please follow our documentation to instal l it manually.
Microsoft SQL Server
? (9/15) Which *development* database would you like to use? (Use arrow keys)
> H2 with disk-based persistence
H2 with in-memory persistence
MySQL
? (10/15) Do you want to use Hibernate 2nd level cache? (Use arrow keys)
No
Yes, with ehcache (local cache, for a single node)
> Yes, with HazelCast (distributed cache, for multiple nodes)
? (11/15) Would you like to use Maven or Gradle for building the backend? (Use arrow keys)
> Maven
Gradle
? (12/15) Which other technologies would you like to use? (Press <space> to select, <a> to toggle all, <i> to inverse selection)
>( ) Search engine using Elasticsearch
( ) [BETA] Asynchronous messages using Apache Kafka
? (13/15) Would you like to enable internationalization support? Yes
? Please choose the native language of the application? (Use arrow keys)
Catalan
> Chinese (Simplified)
Chinese (Traditional)
Czech
Danish
Dutch
English
? Please choose additional languages to install (Press <space> to select, <a> to toggle all, <i> to inverse selection)
>( ) Catalan
( ) Chinese (Traditional)
( ) Czech
( ) Danish
( ) Dutch
( ) English
( ) Estonian
(Move up and down to reveal more choices)
? (14/15) Besides JUnit and Karma, which testing frameworks would you like to use? (Press <space> to select, <a> to toggle all, <i> to inv erse selection)
>( ) Gatling
( ) Cucumber
创建微服务网关
mkdir gateway
cd gateway
yo jhipster
? (1/15) Which *type* of application would you like to create?
Monolithic application (recommended for simple projects)
Microservice application
> Microservice gateway
[BETA] JHipster UAA server (for microservice OAuth2 authentication)
? (2/15) Which *Framework* would you like to use for the client?
AngularJS 1.x
> [BETA] Angular 2.x
? (3/15) What is the base name of your application? gateway
? (4/15) Would you like to install other generators from the JHipster Marketplace? No
? (5/15) As you are running in a microservice architecture, on which port would like your server to run? It should be unique to avoid port conflicts. 8080
? (6/15) What is your default Java package name? com.shunneng.gateway
? (7/15) Which *type* of authentication would you like to use?
JWT authentication (stateless, with a token)
> [BETA] Authentication with JHipster UAA server (the server must be generated separately)
? (8/15) What is the folder path of your UAA application?. ../uaa
? (9/15) Which Service Discovery and Configuration solution would you like to use? (Use arrow keys)
> JHipster Registry (using Eureka and Spring Cloud Config)
[BETA] Consul (using Spring Cloud Consul)
No Service Discovery and Configuration
? (10/15) Which *type* of database would you like to use? (Use arrow keys) //选择数据库类型
> SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle) //关系型数据库
MongoDB //NoSQL
Cassandra //NoSQL
? (11/15) Which *production* database would you like to use? (Use arrow keys) //生产数据库
> MySQL
MariaDB
PostgreSQL
Oracle - Warning! The Oracle JDBC driver (ojdbc) is not bundled because it is not Open Source. Please follow our documentation to instal l it manually.
Microsoft SQL Server
? (12/15) Which *development* database would you like to use? (Use arrow keys) //开发数据库
> H2 with disk-based persistence //数据存储在磁盘的H2
H2 with in-memory persistence //内存H2(服务关闭数据丢失)
MySQL
? (13/15) Do you want to use Hibernate 2nd level cache? (Use arrow keys) //Hibernate 二级缓存
No
> Yes, with ehcache (local cache, for a single node) //本地缓存方案 ehcache
Yes, with HazelCast (distributed cache, for multiple nodes) //集群缓存方案,多节点缓存,适合多微服务的分布式环境
? (14/15) Would you like to use Maven or Gradle for building the backend? (Use arrow keys) //选择后台构建系统
> Maven //更成熟,稳定,用户群体更大
Gradle //更灵活,易于扩展,支持maven一键转Gradle
? (15/15) Which other technologies would you like to use? (Press <space> to select) //可选技术
>( ) Social login (Google, Facebook, Twitter) //第三方社交登录,基于OAuth2.0
( ) Search engine using ElasticSearch //集成搜索开源搜索引擎 ElasticSearch
( ) Clustered HTTP sessions using Hazelcast //使用Hazelcast管理http session集群
( ) WebSockets using Spring Websocket //使用Spring Websocket
( ) [BETA] Asynchronous messages using Apache Kafka //Apache Kafka 是一种高吞吐量的分布式发布订阅消息系统
? (16/15) Would you like to use the LibSass stylesheet preprocessor for your CSS? (y/N) //建议使用gulp定时构建,将sass转换成css而不是运行时处理
? (17/15) Would you like to enable internationalization support? (Y/n) //是否使用国际化
? Please choose the native language of the application? (Use arrow keys) //选择本地化语言
Catalan
> Chinese (Simplified) //中文简体
Chinese (Traditional)
Czech
Danish
Dutch
English
(Move up and down to reveal more choices)
? Please choose additional languages to install (Press <space> to select)//选择其余支持语言
>( ) Catalan
( ) Chinese (Traditional)
( ) Czech
( ) Danish
( ) Dutch
( ) English
( ) French
(Move up and down to reveal more choices)
? (18/15) Which testing frameworks would you like to use? (Press <space> to select) //默认情况下 JHipster 提供 java 单元/集成测试(使用Spring JUnit支持)和 JavaScript 单元测试(使用Karma.js)。这也是一个可选项。
>( ) Gatling //使用 Gatling 进行性能测试。
( ) Cucumber //使用 Cucumber 模拟用户行为
( ) Protractor //使用 Protractor 对 AngularJS 进行集成测试
创建微服务应用
mkdir microservice
cd microservice
yo jhipster
? (1/15) Which *type* of application would you like to create? (Use arrow keys) //选择创建的应用类型
Monolithic application (recommended for simple projects) //综合应用
> Microservice application //微服务应用
Microservice gateway //微服务网关
[BETA] JHipster UAA server (for microservice OAuth2 authentication) //微服务OAuth2的身份认证服务
? (2/15) What is the base name of your application? (microservice) //服务名
? (3/15) Would you like to install other generators from the JHipster Marketplace? No
? (4/15) As you are running in a microservice architecture, on which port would like your server to run? It should be unique to avoid port conflicts. 8081
? (5/15) What is your default Java package name? (com.shunneng.microservice) //默认包名
? (6/15) Which *type* of authentication would you like to use? (Use arrow keys) //选择认证方式,如果选择UAA,需要先创建UAA才能创建微服务
JWT authentication (stateless, with a token) //J(son)W(eb)T(oken)(无状态)
> [BETA] Authentication with JHipster UAA server (the server must be generated separately) //jhipsterUAA 认证服务,需要单独创建
? (7/15) What is the folder path of your UAA application?. (../uaa)
? (8/15) Which Service Discovery and Configuration solution would you like to use? (Use arrow keys)
> JHipster Registry (using Eureka and Spring Cloud Config)
[BETA] Consul (using Spring Cloud Consul)
No Service Discovery and Configuration
? (9/15) Which *type* of database would you like to use? (Use arrow keys) //选择数据库类型
no database
> SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle) //关系型数据库
MongoDB //NoSQL
Cassandra //NoSQL
? (10/15) Which *production* database would you like to use? (Use arrow keys) //生产数据库
> MySQL
MariaDB
PostgreSQL
Oracle - Warning! The Oracle JDBC driver (ojdbc) is not bundled because it is not Open Source. Please follow our documentation to instal l it manually.
Microsoft SQL Server
? (11/15) Which *development* database would you like to use? (Use arrow keys) //开发数据库
> H2 with disk-based persistence //数据存储在磁盘的H2
H2 with in-memory persistence //内存H2(服务关闭数据丢失)
MySQL
? (12/15) Do you want to use Hibernate 2nd level cache? (Use arrow keys) //Hibernate 二级缓存
No
Yes, with ehcache (local cache, for a single node) //本地缓存方案 ehcache
> Yes, with HazelCast (distributed cache, for multiple nodes) //集群缓存方案,多节点缓存,适合多微服务的分布式环境
? (13/15) Would you like to use Maven or Gradle for building the backend? (Use arrow keys) //选择后台构建系统
> Maven //更成熟,稳定,用户群体更大
Gradle //更灵活,易于扩展,支持maven一键转Gradle
? (14/15) Which other technologies would you like to use? (Press <space> to select) //可选技术
>( ) Search engine using ElasticSearch //集成搜索开源搜索引擎 ElasticSearch
( ) [BETA] Asynchronous messages using Apache Kafka //Apache Kafka 是一种高吞吐量的分布式发布订阅消息系统
? (15/15) Would you like to enable internationalization support? (Y/n) //是否使用国际化
? Please choose the native language of the application? (Use arrow keys) //选择本地化语言
Catalan
> Chinese (Simplified) //中文简体
Chinese (Traditional)
Czech
Danish
Dutch
English
(Move up and down to reveal more choices)
? Please choose additional languages to install (Press <space> to select)//选择其余支持语言
>( ) Catalan
( ) Chinese (Traditional)
( ) Czech
( ) Danish
( ) Dutch
( ) English
( ) French
(Move up and down to reveal more choices)
? (16/15) Which testing frameworks would you like to use? (Press <space> to select) //默认情况下 JHipster 提供 java 单元/集成测试(使用Spring JUnit支持)和 JavaScript 单元测试(使用Karma.js)。这也是一个可选项。
>( ) Gatling //使用 Gatling 进行性能测试。
( ) Cucumber //使用 Cucumber 模拟用户行为