jHipster - 微服务搭建

作者: CC_简书 | 来源:发表于2017-01-20 11:01 被阅读7141次

    jHipster 整合了springcloud 框架 也包含了EurekaServer ConfigServer等服务,我们通过一些简单的命令就能部署一套基于微服务的系统

    Paste_Image.png

    [TOC]

    jHipster微服务的几个模块

    jHipster Registry

    jhipster registry是一个基于spring cloud的配置中心。所有的微服务APP都需要注册到这里。
    我们不需要手动的去创建这个项目,jHipster已经为我们准备好了。
    https://github.com/jhipster/jhipster-registry

    # 检出
    git clone https://github.com/jhipster/jhipster-registry.git
    # 编译启动
    mvn clean package
    java -jar target/jhipster-registry-2.5.7.war
    

    通过浏览器登录
    http://localhost:8761/
    帐号 admin 密码 admin

    Paste_Image.png

    uaa

    部署完jHipster registry ,我们需要创建一个用于控制访问权限的项目。前提是我们已经安装好了jHipster

    ## 创建文件夹
    mkdir cn.ctodb.uaa
    cd cn.ctodb.uaa
    yo jhipster
    

    下面就是项目创建过程中的选项

            ██  ██    ██  ████████  ███████    ██████  ████████  ████████  ███████
            ██  ██    ██     ██     ██    ██  ██          ██     ██        ██    ██
            ██  ████████     ██     ███████    █████      ██     ██████    ███████
      ██    ██  ██    ██     ██     ██             ██     ██     ██        ██   ██
       ██████   ██    ██  ████████  ██        ██████      ██     ████████  ██    ██
    
                                http://jhipster.github.io
    
    Welcome to the JHipster Generator v3.12.2
    Documentation for creating an application: https://jhipster.github.io/creating-an-app/
    Application files will be generated in folder: C:\ws\ctodb-msp\uaa
    ? (1/14) Which *type* of application would you like to create? [BETA] JHipster UAA server (for microservice OAuth2 authentication)
    ? (2/14) What is the base name of your application? uaa
    ? (3/14) Would you like to install other generators from the JHipster Market Place? No
    ? (3/14) 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
    ? (4/14) What is your default Java package name? cn.ctodb.uaa
    ? (5/14) Which Service Discovery and Configuration solution would you like to use? JHipster Registry (using Eureka and Spring Cloud Config)
    ? (6/14) Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle, MSSQL)
    ? (7/14) Which *production* database would you like to use? MySQL
    ? (8/14) Which *development* database would you like to use? MySQL
    ? (9/14) Do you want to use Hibernate 2nd level cache? Yes, with HazelCast (distributed cache, for multiple nodes)
    ? (10/14) Would you like to use Maven or Gradle for building the backend? Maven
    ? (11/14) Which other technologies would you like to use? (Press <space> to select, <a> to toggle all, <i> to inverse selection)
    ? (12/14) Would you like to enable internationalization support? Yes
    ? Please choose the native language of the application? Chinese (Simplified)
    ? Please choose additional languages to install (Press <space> to select, <a> to toggle all, <i> to inverse selection)
    ? (13/14) Which testing frameworks would you like to use? (Press <space> to select, <a> to toggle all, <i> to inverse selection)Gatling
    
    Installing languages: zh-cn for server
       create README.md
       create .gitignore
       create .gitattributes
       create .editorconfig
       create .travis.yml
       create Jenkinsfile
       create src\main\docker\Dockerfile
       create src\main\docker\app.yml
       create src\main\docker\mysql.yml
       create src\main\docker\central-server-config\README.md
       create src\main\docker\jhipster-registry.yml
       create src\main\docker\central-server-config\docker-config\application.yml
       create src\main\docker\central-server-config\localhost-config\application.ym
       create src\main\docker\sonar.yml
       create mvnw
       create mvnw.cmd
       create .mvn\wrapper\maven-wrapper.jar
       create .mvn\wrapper\maven-wrapper.properties
       create pom.xml
       create src\main\resources\banner.txt
       create src\main\java\cn\ctodb\uaa\config\jcache\JCacheGaugeSet.java
       create src\main\resources\templates\error.html
       create src\main\resources\logback-spring.xml
       create src\main\resources\config\application.yml
       create src\main\resources\config\application-dev.yml
       create src\main\resources\config\application-prod.yml
       create src\main\resources\config\liquibase\changelog\00000000000000_initial_
       create src\main\resources\config\liquibase\master.xml
       create src\main\resources\i18n\messages.properties
       create src\main\java\cn\ctodb\uaa\security\SpringSecurityAuditorAware.java
       create src\main\java\cn\ctodb\uaa\security\SecurityUtils.java
       create src\main\java\cn\ctodb\uaa\security\AuthoritiesConstants.java
       create src\main\java\cn\ctodb\uaa\config\UaaWebSecurityConfiguration.java
       create src\main\java\cn\ctodb\uaa\config\UaaConfiguration.java
       create src\main\java\cn\ctodb\uaa\config\LoadBalancedResourceDetails.java
       create src\main\java\cn\ctodb\uaa\security\Http401UnauthorizedEntryPoint.jav
       create src\main\java\cn\ctodb\uaa\security\UserDetailsService.java
       create src\main\java\cn\ctodb\uaa\security\UserNotActivatedException.java
       create src\main\java\cn\ctodb\uaa\security\package-info.java
       create src\main\resources\config\bootstrap.yml
       create src\main\resources\config\bootstrap-dev.yml
       create src\main\resources\config\bootstrap-prod.yml
       create src\main\java\cn\ctodb\uaa\config\metrics\SpectatorLogMetricWriter.ja
       create src\main\java\cn\ctodb\uaa\UaaApp.java
       create src\main\java\cn\ctodb\uaa\ApplicationWebXml.java
       create src\main\java\cn\ctodb\uaa\aop\logging\LoggingAspect.java
       create src\main\java\cn\ctodb\uaa\config\DefaultProfileUtil.java
       create src\main\java\cn\ctodb\uaa\config\apidoc\package-info.java
       create src\main\java\cn\ctodb\uaa\config\apidoc\SwaggerConfiguration.java
       create src\main\java\cn\ctodb\uaa\config\apidoc\PageableParameterBuilderPlug
       create src\main\java\cn\ctodb\uaa\async\package-info.java
       create src\main\java\cn\ctodb\uaa\async\ExceptionHandlingAsyncTaskExecutor.j
       create src\main\java\cn\ctodb\uaa\config\package-info.java
       create src\main\java\cn\ctodb\uaa\config\AsyncConfiguration.java
       create src\main\java\cn\ctodb\uaa\config\CacheConfiguration.java
       create src\main\java\cn\ctodb\uaa\config\Constants.java
       create src\main\java\cn\ctodb\uaa\config\DateTimeFormatConfiguration.java
       create src\main\java\cn\ctodb\uaa\config\LoggingConfiguration.java
       create src\main\java\cn\ctodb\uaa\config\CloudDatabaseConfiguration.java
       create src\main\java\cn\ctodb\uaa\config\DatabaseConfiguration.java
       create src\main\java\cn\ctodb\uaa\config\audit\package-info.java
       create src\main\java\cn\ctodb\uaa\config\audit\AuditEventConverter.java
       create src\main\java\cn\ctodb\uaa\config\JHipsterProperties.java
       create src\main\java\cn\ctodb\uaa\config\LocaleConfiguration.java
       create src\main\java\cn\ctodb\uaa\config\LoggingAspectConfiguration.java
       create src\main\java\cn\ctodb\uaa\config\MetricsConfiguration.java
       create src\main\java\cn\ctodb\uaa\config\ThymeleafConfiguration.java
       create src\main\java\cn\ctodb\uaa\config\WebConfigurer.java
       create src\main\java\cn\ctodb\uaa\config\locale\package-info.java
       create src\main\java\cn\ctodb\uaa\config\locale\AngularCookieLocaleResolver.
       create src\main\java\cn\ctodb\uaa\config\liquibase\AsyncSpringLiquibase.java
       create src\main\java\cn\ctodb\uaa\config\liquibase\package-info.java
       create src\main\java\cn\ctodb\uaa\domain\package-info.java
       create src\main\java\cn\ctodb\uaa\domain\util\JSR310DateConverters.java
       create src\main\java\cn\ctodb\uaa\domain\util\FixedH2Dialect.java
       create src\main\java\cn\ctodb\uaa\domain\AbstractAuditingEntity.java
       create src\main\java\cn\ctodb\uaa\domain\PersistentAuditEvent.java
       create src\main\java\cn\ctodb\uaa\repository\package-info.java
       create src\main\java\cn\ctodb\uaa\service\package-info.java
       create src\main\java\cn\ctodb\uaa\service\util\RandomUtil.java
       create src\main\java\cn\ctodb\uaa\web\rest\errors\ErrorConstants.java
       create src\main\java\cn\ctodb\uaa\web\rest\errors\CustomParameterizedExcepti
       create src\main\java\cn\ctodb\uaa\web\rest\errors\ErrorVM.java
       create src\main\java\cn\ctodb\uaa\web\rest\errors\ExceptionTranslator.java
       create src\main\java\cn\ctodb\uaa\web\rest\errors\FieldErrorVM.java
       create src\main\java\cn\ctodb\uaa\web\rest\errors\ParameterizedErrorVM.java
       create src\main\java\cn\ctodb\uaa\web\filter\package-info.java
       create src\main\java\cn\ctodb\uaa\web\filter\CachingHttpHeadersFilter.java
       create src\main\java\cn\ctodb\uaa\web\rest\vm\package-info.java
       create src\main\java\cn\ctodb\uaa\web\rest\vm\LoggerVM.java
       create src\main\java\cn\ctodb\uaa\web\rest\util\HeaderUtil.java
       create src\main\java\cn\ctodb\uaa\web\rest\util\PaginationUtil.java
       create src\main\java\cn\ctodb\uaa\web\rest\package-info.java
       create src\main\java\cn\ctodb\uaa\web\rest\LogsResource.java
       create src\main\java\cn\ctodb\uaa\web\rest\ProfileInfoResource.java
       create src\test\java\cn\ctodb\uaa\web\rest\TestUtil.java
       create src\test\resources\config\application.yml
       create src\test\resources\logback-test.xml
       create src\test\resources\config\bootstrap.yml
       create src\test\java\cn\ctodb\uaa\security\OAuth2TokenMockUtil.java
       create src\test\java\cn\ctodb\uaa\config\SecurityBeanOverrideConfiguration.j
       create src\test\gatling\conf\gatling.conf
       create src\test\gatling\conf\logback.xml
       create src\main\resources\config\liquibase\users.csv
       create src\main\resources\config\liquibase\authorities.csv
       create src\main\resources\config\liquibase\users_authorities.csv
       create src\main\resources\mails\activationEmail.html
       create src\main\resources\mails\creationEmail.html
       create src\main\resources\mails\passwordResetEmail.html
       create src\main\java\cn\ctodb\uaa\domain\User.java
       create src\main\java\cn\ctodb\uaa\domain\Authority.java
       create src\main\java\cn\ctodb\uaa\repository\CustomAuditEventRepository.java
       create src\main\java\cn\ctodb\uaa\repository\AuthorityRepository.java
       create src\main\java\cn\ctodb\uaa\repository\PersistenceAuditEventRepository
       create src\main\java\cn\ctodb\uaa\repository\UserRepository.java
       create src\main\java\cn\ctodb\uaa\service\UserService.java
       create src\main\java\cn\ctodb\uaa\service\MailService.java
       create src\main\java\cn\ctodb\uaa\service\AuditEventService.java
       create src\main\java\cn\ctodb\uaa\service\dto\package-info.java
       create src\main\java\cn\ctodb\uaa\service\dto\UserDTO.java
       create src\main\java\cn\ctodb\uaa\web\rest\vm\ManagedUserVM.java
       create src\main\java\cn\ctodb\uaa\web\rest\UserResource.java
       create src\main\java\cn\ctodb\uaa\web\rest\AccountResource.java
       create src\main\java\cn\ctodb\uaa\web\rest\vm\KeyAndPasswordVM.java
       create src\main\java\cn\ctodb\uaa\service\mapper\package-info.java
       create src\main\java\cn\ctodb\uaa\service\mapper\UserMapper.java
       create src\main\java\cn\ctodb\uaa\web\rest\AuditResource.java
       create src\test\java\cn\ctodb\uaa\service\UserServiceIntTest.java
       create src\test\java\cn\ctodb\uaa\web\rest\UserResourceIntTest.java
       create src\test\java\cn\ctodb\uaa\web\rest\AccountResourceIntTest.java
       create src\test\java\cn\ctodb\uaa\security\SecurityUtilsUnitTest.java
       create src\test\java\cn\ctodb\uaa\web\rest\AuditResourceIntTest.java
       create src\main\resources\i18n\messages_zh_cn.properties
    
    Server app generated successfully.
    
    
    KeyStore 'src/main/resources/keystore.jks' generated successfully.
    

    修改里面的application-dev.yml配置

    • mysql 连接的配置
    • eureka 服务的配置,改为jHipster registry服务的地址。同时还需要修改bootstrap-dev.yml(如果都在一台电脑启动这个就不用变)

    编译启动UAA

    mvn clean package
    java -jar target/uaa-0.0.1-SNAPSHOT.war
    

    app(microservice)

    创建一个微服务
    操作同uaa

    ## 创建文件夹
    mkdir cn.ctodb.app
    cd cn.ctodb.app
    yo jhipster
    

    选项与uaa有差异。类型需要选择微服务类型,权限需要选择上面创建的uaa路径。详细选择参考下面记录

    
            ██  ██    ██  ████████  ███████    ██████  ████████  ████████  ███████
            ██  ██    ██     ██     ██    ██  ██          ██     ██        ██    ██
            ██  ████████     ██     ███████    █████      ██     ██████    ███████
      ██    ██  ██    ██     ██     ██             ██     ██     ██        ██   ██
       ██████   ██    ██  ████████  ██        ██████      ██     ████████  ██    ██
    
                                http://jhipster.github.io
    
    Welcome to the JHipster Generator v3.12.2
    Documentation for creating an application: https://jhipster.github.io/creating-an-app/
    Application files will be generated in folder: C:\ws\ctodb-msp\cn.ctodb.app
    ? (1/14) Which *type* of application would you like to create? Microservice application
    ? (2/14) What is the base name of your application? app
    ? (3/14) Would you like to install other generators from the JHipster Market Place? No
    ? (3/14) 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
    ? (4/14) What is your default Java package name? cn.ctodb.app
    ? (5/14) Which *type* of authentication would you like to use? [BETA] Authentication with JHipster UAA server (the server must be generated separately)
    ? (6/14) What is the folder path of your UAA application?. ../cn.ctodb.uaa
    ? (7/14) Which Service Discovery and Configuration solution would you like to use? JHipster Registry (using Eureka and Spring Cloud Config)
    ? (8/14) Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle)
    ? (9/14) Which *production* database would you like to use? MySQL
    ? (10/14) Which *development* database would you like to use? MySQL
    ? (11/14) Do you want to use Hibernate 2nd level cache? Yes, with HazelCast (distributed cache, for multiple nodes)
    ? (12/14) Would you like to use Maven or Gradle for building the backend? Maven
    ? (13/14) Which other technologies would you like to use? (Press <space> to select, <a> to toggle all, <i> to inverse selection)
    ? (14/14) Would you like to enable internationalization support? Yes
    ? Please choose the native language of the application? Chinese (Simplified)
    ? Please choose additional languages to install (Press <space> to select, <a> to toggle all, <i> to inverse selection)
    ? (15/14) Which testing frameworks would you like to use? (Press <space> to select, <a> to toggle all, <i> to inverse selection)Gatling
    
    Installing languages: zh-cn for server
       create README.md
       create .gitignore
       create .gitattributes
       create .editorconfig
       create .travis.yml
       create Jenkinsfile
       create src\main\docker\Dockerfile
       create src\main\docker\app.yml
       create src\main\docker\mysql.yml
       create src\main\docker\central-server-config\README.md
       create src\main\docker\jhipster-registry.yml
       create src\main\docker\central-server-config\docker-config\application.yml
       create src\main\docker\central-server-config\localhost-config\application.yml
       create src\main\docker\sonar.yml
       create mvnw
       create mvnw.cmd
       create .mvn\wrapper\maven-wrapper.jar
       create .mvn\wrapper\maven-wrapper.properties
       create pom.xml
       create src\main\resources\banner.txt
       create src\main\java\cn\ctodb\app\config\jcache\JCacheGaugeSet.java
       create src\main\resources\templates\error.html
       create src\main\resources\logback-spring.xml
       create src\main\resources\config\application.yml
       create src\main\resources\config\application-dev.yml
       create src\main\resources\config\application-prod.yml
       create src\main\resources\config\liquibase\changelog\00000000000000_initial_schema.xml
       create src\main\resources\config\liquibase\master.xml
       create src\main\resources\i18n\messages.properties
       create src\main\java\cn\ctodb\app\security\SpringSecurityAuditorAware.java
       create src\main\java\cn\ctodb\app\security\SecurityUtils.java
       create src\main\java\cn\ctodb\app\security\AuthoritiesConstants.java
       create src\main\java\cn\ctodb\app\config\MicroserviceSecurityConfiguration.java
       create src\main\java\cn\ctodb\app\config\LoadBalancedResourceDetails.java
       create src\main\java\cn\ctodb\app\config\FeignConfiguration.java
       create src\main\java\cn\ctodb\app\client\AuthorizedFeignClient.java
       create src\main\java\cn\ctodb\app\client\OAuth2InterceptedFeignConfiguration.java
       create src\main\resources\config\bootstrap.yml
       create src\main\resources\config\bootstrap-dev.yml
       create src\main\resources\config\bootstrap-prod.yml
       create src\main\java\cn\ctodb\app\config\metrics\SpectatorLogMetricWriter.java
       create src\main\java\cn\ctodb\app\AppApp.java
       create src\main\java\cn\ctodb\app\ApplicationWebXml.java
       create src\main\java\cn\ctodb\app\aop\logging\LoggingAspect.java
       create src\main\java\cn\ctodb\app\config\DefaultProfileUtil.java
       create src\main\java\cn\ctodb\app\config\apidoc\package-info.java
       create src\main\java\cn\ctodb\app\config\apidoc\SwaggerConfiguration.java
       create src\main\java\cn\ctodb\app\config\apidoc\PageableParameterBuilderPlugin.java
       create src\main\java\cn\ctodb\app\async\package-info.java
       create src\main\java\cn\ctodb\app\async\ExceptionHandlingAsyncTaskExecutor.java
       create src\main\java\cn\ctodb\app\config\package-info.java
       create src\main\java\cn\ctodb\app\config\AsyncConfiguration.java
       create src\main\java\cn\ctodb\app\config\CacheConfiguration.java
       create src\main\java\cn\ctodb\app\config\Constants.java
       create src\main\java\cn\ctodb\app\config\DateTimeFormatConfiguration.java
       create src\main\java\cn\ctodb\app\config\LoggingConfiguration.java
       create src\main\java\cn\ctodb\app\config\CloudDatabaseConfiguration.java
       create src\main\java\cn\ctodb\app\config\DatabaseConfiguration.java
       create src\main\java\cn\ctodb\app\config\audit\package-info.java
       create src\main\java\cn\ctodb\app\config\audit\AuditEventConverter.java
       create src\main\java\cn\ctodb\app\config\JHipsterProperties.java
       create src\main\java\cn\ctodb\app\config\LocaleConfiguration.java
       create src\main\java\cn\ctodb\app\config\LoggingAspectConfiguration.java
       create src\main\java\cn\ctodb\app\config\MetricsConfiguration.java
       create src\main\java\cn\ctodb\app\config\ThymeleafConfiguration.java
       create src\main\java\cn\ctodb\app\config\WebConfigurer.java
       create src\main\java\cn\ctodb\app\config\locale\package-info.java
       create src\main\java\cn\ctodb\app\config\locale\AngularCookieLocaleResolver.java
       create src\main\java\cn\ctodb\app\config\liquibase\AsyncSpringLiquibase.java
       create src\main\java\cn\ctodb\app\config\liquibase\package-info.java
       create src\main\java\cn\ctodb\app\domain\package-info.java
       create src\main\java\cn\ctodb\app\domain\util\JSR310DateConverters.java
       create src\main\java\cn\ctodb\app\domain\util\FixedH2Dialect.java
       create src\main\java\cn\ctodb\app\domain\AbstractAuditingEntity.java
       create src\main\java\cn\ctodb\app\domain\PersistentAuditEvent.java
       create src\main\java\cn\ctodb\app\repository\package-info.java
       create src\main\java\cn\ctodb\app\service\package-info.java
       create src\main\java\cn\ctodb\app\web\rest\errors\ErrorConstants.java
       create src\main\java\cn\ctodb\app\web\rest\errors\CustomParameterizedException.java
       create src\main\java\cn\ctodb\app\web\rest\errors\ErrorVM.java
       create src\main\java\cn\ctodb\app\web\rest\errors\ExceptionTranslator.java
       create src\main\java\cn\ctodb\app\web\rest\errors\FieldErrorVM.java
       create src\main\java\cn\ctodb\app\web\rest\errors\ParameterizedErrorVM.java
       create src\main\java\cn\ctodb\app\web\filter\package-info.java
       create src\main\java\cn\ctodb\app\web\filter\CachingHttpHeadersFilter.java
       create src\main\java\cn\ctodb\app\web\rest\vm\package-info.java
       create src\main\java\cn\ctodb\app\web\rest\vm\LoggerVM.java
       create src\main\java\cn\ctodb\app\web\rest\util\HeaderUtil.java
       create src\main\java\cn\ctodb\app\web\rest\util\PaginationUtil.java
       create src\main\java\cn\ctodb\app\web\rest\package-info.java
       create src\main\java\cn\ctodb\app\web\rest\LogsResource.java
       create src\main\java\cn\ctodb\app\web\rest\ProfileInfoResource.java
       create src\test\java\cn\ctodb\app\web\rest\TestUtil.java
       create src\test\resources\config\application.yml
       create src\test\resources\logback-test.xml
       create src\test\resources\config\bootstrap.yml
       create src\test\java\cn\ctodb\app\security\OAuth2TokenMockUtil.java
       create src\test\java\cn\ctodb\app\config\SecurityBeanOverrideConfiguration.java
       create src\test\gatling\conf\gatling.conf
       create src\test\gatling\conf\logback.xml
       create src\main\resources\i18n\messages_zh_cn.properties
    
    Server app generated successfully.
    

    同样还需要修改数据库配置,然后启动项目(参考uaa)

    gateway

    创建一个网关,用来做为所有请求的入口
    操作同uaa

    ## 创建文件夹
    mkdir cn.ctodb.app
    cd cn.ctodb.app
    yo jhipster
    

    选项与uaa ,app 有差异。类型需要选择网关类型,权限需要选择上面创建的uaa路径。同时生成的项目文件包含了页面。详细选择参考下面记录

    
            ██  ██    ██  ████████  ███████    ██████  ████████  ████████  ███████
            ██  ██    ██     ██     ██    ██  ██          ██     ██        ██    ██
            ██  ████████     ██     ███████    █████      ██     ██████    ███████
      ██    ██  ██    ██     ██     ██             ██     ██     ██        ██   ██
       ██████   ██    ██  ████████  ██        ██████      ██     ████████  ██    ██
    
                                http://jhipster.github.io
    
    Welcome to the JHipster Generator v3.12.2
    Documentation for creating an application: https://jhipster.github.io/creating-an-app/
    Application files will be generated in folder: C:\ws\ctodb-msp\gateway
    ? (1/14) Which *type* of application would you like to create? Microservice gateway
    ? (2/14) What is the base name of your application? gateway
    ? (3/14) Would you like to install other generators from the JHipster Market Place? No
    ? (3/14) 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
    ? (4/14) What is your default Java package name? cn.ctodb.gateway
    ? (5/14) Which *type* of authentication would you like to use? [BETA] Authentication with JHipster UAA server (the server must be generated separately)
    ? (6/14) What is the folder path of your UAA application?. ../cn.ctodb.uaa
    ? (7/14) Which Service Discovery and Configuration solution would you like to use? JHipster Registry (using Eureka and Spring Cloud Config)
    ? (8/14) Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle, MSSQL)
    ? (9/14) Which *production* database would you like to use? MySQL
    ? (10/14) Which *development* database would you like to use? MySQL
    ? (11/14) Do you want to use Hibernate 2nd level cache? Yes, with HazelCast (distributed cache, for multiple nodes)
    ? (12/14) Would you like to use Maven or Gradle for building the backend? Maven
    ? (13/14) Which other technologies would you like to use? (Press <space> to select, <a> to toggle all, <i> to inverse selection)
    ? (14/14) Would you like to use the LibSass stylesheet preprocessor for your CSS? No
    ? (15/14) Would you like to enable internationalization support? Yes
    ? Please choose the native language of the application? Chinese (Simplified)
    ? Please choose additional languages to install (Press <space> to select, <a> to toggle all, <i> to inverse selection)
    ? (16/14) Which testing frameworks would you like to use? (Press <space> to select, <a> to toggle all, <i> to inverse selection)Gatling
    
    Installing languages: zh-cn
       create bower.json
       create package.json
       create README.md
       create .gitignore
       create .gitattributes
       create .editorconfig
       create .travis.yml
       create Jenkinsfile
       create src\main\docker\Dockerfile
       create src\main\docker\app.yml
       create src\main\docker\mysql.yml
       create src\main\docker\cassandra.yml
       create src\main\docker\cassandra-cluster.yml
       create src\main\docker\cassandra-migration.yml
       create src\main\docker\cassandra\Cassandra-Migration.Dockerfile
       create src\main\docker\cassandra\scripts\autoMigrate.sh
       create src\main\docker\cassandra\scripts\execute-cql.sh
       create src\main\docker\central-server-config\README.md
       create src\main\docker\jhipster-registry.yml
       create src\main\docker\central-server-config\docker-config\application.yml
       create src\main\docker\central-server-config\localhost-config\application.yml
       create src\main\docker\sonar.yml
       create mvnw
       create mvnw.cmd
       create .mvn\wrapper\maven-wrapper.jar
       create .mvn\wrapper\maven-wrapper.properties
       create pom.xml
       create src\main\resources\banner.txt
       create src\main\java\cn\ctodb\gateway\config\jcache\JCacheGaugeSet.java
       create src\main\resources\templates\error.html
       create src\main\resources\logback-spring.xml
       create src\main\resources\config\application.yml
       create src\main\resources\config\application-dev.yml
       create src\main\resources\config\application-prod.yml
       create src\main\resources\config\liquibase\changelog\00000000000000_initial_schema.xml
       create src\main\resources\config\liquibase\master.xml
       create src\main\resources\config\cql\create-keyspace-prod.cql
       create src\main\resources\config\cql\create-keyspace.cql
       create src\main\resources\config\cql\drop-keyspace.cql
       create src\main\resources\config\cql\changelog\README.md
       create src\main\resources\i18n\messages.properties
       create src\main\java\cn\ctodb\gateway\security\SpringSecurityAuditorAware.java
       create src\main\java\cn\ctodb\gateway\security\SecurityUtils.java
       create src\main\java\cn\ctodb\gateway\security\AuthoritiesConstants.java
       create src\main\java\cn\ctodb\gateway\config\GatewayConfiguration.java
       create src\main\java\cn\ctodb\gateway\config\apidoc\GatewaySwaggerResourcesProvider.java
       create src\main\java\cn\ctodb\gateway\gateway\ratelimiting\RateLimitingFilter.java
       create src\main\java\cn\ctodb\gateway\gateway\TokenRelayFilter.java
       create src\main\java\cn\ctodb\gateway\gateway\ratelimiting\RateLimitingRepository.java
       create src\main\java\cn\ctodb\gateway\gateway\accesscontrol\AccessControlFilter.java
       create src\main\java\cn\ctodb\gateway\gateway\responserewriting\SwaggerBasePathRewritingFilter.java
       create src\main\java\cn\ctodb\gateway\web\rest\vm\RouteVM.java
       create src\main\java\cn\ctodb\gateway\web\rest\GatewayResource.java
       create src\main\java\cn\ctodb\gateway\config\MicroserviceSecurityConfiguration.java
       create src\main\resources\config\bootstrap.yml
       create src\main\resources\config\bootstrap-dev.yml
       create src\main\resources\config\bootstrap-prod.yml
       create src\main\java\cn\ctodb\gateway\config\metrics\SpectatorLogMetricWriter.java
       create src\main\java\cn\ctodb\gateway\GatewayApp.java
       create src\main\java\cn\ctodb\gateway\ApplicationWebXml.java
       create src\main\java\cn\ctodb\gateway\aop\logging\LoggingAspect.java
       create src\main\java\cn\ctodb\gateway\config\DefaultProfileUtil.java
       create src\main\java\cn\ctodb\gateway\config\apidoc\package-info.java
       create src\main\java\cn\ctodb\gateway\config\apidoc\SwaggerConfiguration.java
       create src\main\java\cn\ctodb\gateway\config\apidoc\PageableParameterBuilderPlugin.java
       create src\main\java\cn\ctodb\gateway\async\package-info.java
       create src\main\java\cn\ctodb\gateway\async\ExceptionHandlingAsyncTaskExecutor.java
       create src\main\java\cn\ctodb\gateway\config\package-info.java
       create src\main\java\cn\ctodb\gateway\config\AsyncConfiguration.java
       create src\main\java\cn\ctodb\gateway\config\CacheConfiguration.java
       create src\main\java\cn\ctodb\gateway\config\Constants.java
       create src\main\java\cn\ctodb\gateway\config\DateTimeFormatConfiguration.java
       create src\main\java\cn\ctodb\gateway\config\LoggingConfiguration.java
       create src\main\java\cn\ctodb\gateway\config\CloudDatabaseConfiguration.java
       create src\main\java\cn\ctodb\gateway\config\DatabaseConfiguration.java
       create src\main\java\cn\ctodb\gateway\config\audit\package-info.java
       create src\main\java\cn\ctodb\gateway\config\audit\AuditEventConverter.java
       create src\main\java\cn\ctodb\gateway\config\JHipsterProperties.java
       create src\main\java\cn\ctodb\gateway\config\LocaleConfiguration.java
       create src\main\java\cn\ctodb\gateway\config\LoggingAspectConfiguration.java
       create src\main\java\cn\ctodb\gateway\config\MetricsConfiguration.java
       create src\main\java\cn\ctodb\gateway\config\ThymeleafConfiguration.java
       create src\main\java\cn\ctodb\gateway\config\WebConfigurer.java
       create src\main\java\cn\ctodb\gateway\config\locale\package-info.java
       create src\main\java\cn\ctodb\gateway\config\locale\AngularCookieLocaleResolver.java
       create src\main\java\cn\ctodb\gateway\config\cassandra\CassandraConfiguration.java
       create src\main\java\cn\ctodb\gateway\config\cassandra\CustomZonedDateTimeCodec.java
       create src\main\java\cn\ctodb\gateway\config\cassandra\package-info.java
       create src\main\java\cn\ctodb\gateway\config\liquibase\AsyncSpringLiquibase.java
       create src\main\java\cn\ctodb\gateway\config\liquibase\package-info.java
       create src\main\java\cn\ctodb\gateway\domain\package-info.java
       create src\main\java\cn\ctodb\gateway\domain\util\JSR310DateConverters.java
       create src\main\java\cn\ctodb\gateway\domain\util\FixedH2Dialect.java
       create src\main\java\cn\ctodb\gateway\domain\AbstractAuditingEntity.java
       create src\main\java\cn\ctodb\gateway\domain\PersistentAuditEvent.java
       create src\main\java\cn\ctodb\gateway\repository\package-info.java
       create src\main\java\cn\ctodb\gateway\service\package-info.java
       create src\main\java\cn\ctodb\gateway\web\rest\errors\ErrorConstants.java
       create src\main\java\cn\ctodb\gateway\web\rest\errors\CustomParameterizedException.java
       create src\main\java\cn\ctodb\gateway\web\rest\errors\ErrorVM.java
       create src\main\java\cn\ctodb\gateway\web\rest\errors\ExceptionTranslator.java
       create src\main\java\cn\ctodb\gateway\web\rest\errors\FieldErrorVM.java
       create src\main\java\cn\ctodb\gateway\web\rest\errors\ParameterizedErrorVM.java
       create src\main\java\cn\ctodb\gateway\web\filter\package-info.java
       create src\main\java\cn\ctodb\gateway\web\filter\CachingHttpHeadersFilter.java
       create src\main\java\cn\ctodb\gateway\web\rest\vm\package-info.java
       create src\main\java\cn\ctodb\gateway\web\rest\vm\LoggerVM.java
       create src\main\java\cn\ctodb\gateway\web\rest\util\HeaderUtil.java
       create src\main\java\cn\ctodb\gateway\web\rest\util\PaginationUtil.java
       create src\main\java\cn\ctodb\gateway\web\rest\package-info.java
       create src\main\java\cn\ctodb\gateway\web\rest\LogsResource.java
       create src\main\java\cn\ctodb\gateway\web\rest\ProfileInfoResource.java
       create src\test\java\cn\ctodb\gateway\web\rest\TestUtil.java
       create src\test\resources\config\application.yml
       create src\test\resources\logback-test.xml
       create src\test\java\cn\ctodb\gateway\gateway\responserewriting\SwaggerBasePathRewritingFilterTest.java
       create src\test\resources\config\bootstrap.yml
       create src\test\java\cn\ctodb\gateway\security\OAuth2TokenMockUtil.java
       create src\test\java\cn\ctodb\gateway\config\SecurityBeanOverrideConfiguration.java
       create src\test\gatling\conf\gatling.conf
       create src\test\gatling\conf\logback.xml
       create .bowerrc
       create .eslintrc.json
       create .eslintignore
       create gulpfile.js
       create gulp\handle-errors.js
       create gulp\utils.js
       create gulp\serve.js
       create gulp\config.js
       create gulp\build.js
       create gulp\copy.js
       create gulp\inject.js
       create src\main\webapp\content\css\main.css
       create src\main\webapp\content\css\documentation.css
       create src\main\webapp\favicon.ico
       create src\main\webapp\robots.txt
       create src\main\webapp\404.html
       create src\main\webapp\swagger-ui\index.html
       create src\main\webapp\swagger-ui\images\throbber.gif
       create src\main\webapp\index.html
       create src\main\webapp\app\app.module.js
       create src\main\webapp\app\app.state.js
       create src\main\webapp\app\app.constants.js
       create src\main\webapp\app\blocks\handlers\state.handler.js
       create src\main\webapp\app\blocks\handlers\translation.handler.js
       create src\main\webapp\app\blocks\config\translation.config.js
       create src\main\webapp\app\blocks\config\translation-storage.provider.js
       create src\main\webapp\app\blocks\config\alert.config.js
       create src\main\webapp\app\blocks\config\http.config.js
       create src\main\webapp\app\blocks\config\localstorage.config.js
       create src\main\webapp\app\blocks\config\compile.config.js
       create src\main\webapp\app\blocks\config\uib-pager.config.js
       create src\main\webapp\app\blocks\config\uib-pagination.config.js
       create src\main\webapp\app\account\account.state.js
       create src\main\webapp\app\account\activate\activate.html
       create src\main\webapp\app\account\activate\activate.state.js
       create src\main\webapp\app\account\activate\activate.controller.js
       create src\main\webapp\app\account\password\password.html
       create src\main\webapp\app\account\password\password.state.js
       create src\main\webapp\app\account\password\password.controller.js
       create src\main\webapp\app\account\password\password-strength-bar.directive.js
       create src\main\webapp\app\account\register\register.html
       create src\main\webapp\app\account\register\register.state.js
       create src\main\webapp\app\account\register\register.controller.js
       create src\main\webapp\app\account\reset\request\reset.request.html
       create src\main\webapp\app\account\reset\request\reset.request.state.js
       create src\main\webapp\app\account\reset\request\reset.request.controller.js
       create src\main\webapp\app\account\reset\finish\reset.finish.html
       create src\main\webapp\app\account\reset\finish\reset.finish.state.js
       create src\main\webapp\app\account\reset\finish\reset.finish.controller.js
       create src\main\webapp\app\account\settings\settings.html
       create src\main\webapp\app\account\settings\settings.state.js
       create src\main\webapp\app\account\settings\settings.controller.js
       create src\main\webapp\app\admin\admin.state.js
       create src\main\webapp\app\admin\audits\audits.html
       create src\main\webapp\app\admin\audits\audits.state.js
       create src\main\webapp\app\admin\audits\audits.controller.js
       create src\main\webapp\app\admin\audits\audits.service.js
       create src\main\webapp\app\admin\configuration\configuration.html
       create src\main\webapp\app\admin\configuration\configuration.state.js
       create src\main\webapp\app\admin\configuration\configuration.controller.js
       create src\main\webapp\app\admin\configuration\configuration.service.js
       create src\main\webapp\app\admin\docs\docs.html
       create src\main\webapp\app\admin\docs\docs.state.js
       create src\main\webapp\app\admin\health\health.html
       create src\main\webapp\app\admin\health\health.modal.html
       create src\main\webapp\app\admin\health\health.state.js
       create src\main\webapp\app\admin\health\health.controller.js
       create src\main\webapp\app\admin\health\health.modal.controller.js
       create src\main\webapp\app\admin\health\health.service.js
       create src\main\webapp\app\admin\logs\logs.html
       create src\main\webapp\app\admin\logs\logs.state.js
       create src\main\webapp\app\admin\logs\logs.controller.js
       create src\main\webapp\app\admin\logs\logs.service.js
       create src\main\webapp\app\admin\metrics\metrics.html
       create src\main\webapp\app\admin\metrics\metrics.modal.html
       create src\main\webapp\app\admin\metrics\metrics.state.js
       create src\main\webapp\app\admin\metrics\metrics.controller.js
       create src\main\webapp\app\admin\metrics\metrics.modal.controller.js
       create src\main\webapp\app\admin\metrics\metrics.service.js
       create src\main\webapp\app\admin\user-management\user-management.html
       create src\main\webapp\app\admin\user-management\user-management-detail.html
       create src\main\webapp\app\admin\user-management\user-management-dialog.html
       create src\main\webapp\app\admin\user-management\user-management-delete-dialog.html
       create src\main\webapp\app\admin\user-management\user-management.state.js
       create src\main\webapp\app\admin\user-management\user-management.controller.js
       create src\main\webapp\app\admin\user-management\user-management-detail.controller.js
       create src\main\webapp\app\admin\user-management\user-management-dialog.controller.js
       create src\main\webapp\app\admin\user-management\user-management-delete-dialog.controller.js
       create src\main\webapp\app\admin\gateway\gateway.html
       create src\main\webapp\app\admin\gateway\gateway.state.js
       create src\main\webapp\app\admin\gateway\gateway.controller.js
       create src\main\webapp\app\admin\gateway\gateway.routes.service.js
       create src\main\webapp\app\components\form\show-validation.directive.js
       create src\main\webapp\app\components\form\maxbytes.directive.js
       create src\main\webapp\app\components\form\minbytes.directive.js
       create src\main\webapp\app\components\form\pagination.constants.js
       create src\main\webapp\app\components\language\language.filter.js
       create src\main\webapp\app\components\language\language.constants.js
       create src\main\webapp\app\components\language\language.controller.js
       create src\main\webapp\app\components\language\language.service.js
       create src\main\webapp\app\components\login\login.html
       create src\main\webapp\app\components\login\login.service.js
       create src\main\webapp\app\components\login\login.controller.js
       create src\main\webapp\app\components\util\base64.service.js
       create src\main\webapp\app\components\util\capitalize.filter.js
       create src\main\webapp\app\components\util\parse-links.service.js
       create src\main\webapp\app\components\util\truncate-characters.filter.js
       create src\main\webapp\app\components\util\truncate-words.filter.js
       create src\main\webapp\app\components\util\date-util.service.js
       create src\main\webapp\app\components\util\data-util.service.js
       create src\main\webapp\app\components\util\pagination-util.service.js
       create src\main\webapp\app\components\util\sort.directive.js
       create src\main\webapp\app\components\util\sort-by.directive.js
       create src\main\webapp\app\components\util\jhi-item-count.directive.js
       create src\main\webapp\app\blocks\interceptor\auth.interceptor.js
       create src\main\webapp\app\blocks\interceptor\auth-expired.interceptor.js
       create src\main\webapp\app\blocks\interceptor\errorhandler.interceptor.js
       create src\main\webapp\app\blocks\interceptor\notification.interceptor.js
       create src\main\webapp\app\components\alert\alert.service.js
       create src\main\webapp\app\components\alert\alert.directive.js
       create src\main\webapp\app\components\alert\alert-error.directive.js
       create src\main\webapp\app\entities\entity.state.js
       create src\main\webapp\app\home\home.html
       create src\main\webapp\app\home\home.state.js
       create src\main\webapp\app\home\home.controller.js
       create src\main\webapp\app\layouts\navbar\active-menu.directive.js
       create src\main\webapp\app\layouts\navbar\navbar.html
       create src\main\webapp\app\layouts\navbar\navbar.controller.js
       create src\main\webapp\app\layouts\error\error.html
       create src\main\webapp\app\layouts\error\accessdenied.html
       create src\main\webapp\app\layouts\error\error.state.js
       create src\main\webapp\app\services\auth\auth.service.js
       create src\main\webapp\app\services\auth\principal.service.js
       create src\main\webapp\app\services\auth\has-authority.directive.js
       create src\main\webapp\app\services\auth\has-any-authority.directive.js
       create src\main\webapp\app\services\auth\auth.jwt.service.js
       create src\main\webapp\app\services\auth\account.service.js
       create src\main\webapp\app\services\auth\activate.service.js
       create src\main\webapp\app\services\auth\password.service.js
       create src\main\webapp\app\services\auth\password-reset-init.service.js
       create src\main\webapp\app\services\auth\password-reset-finish.service.js
       create src\main\webapp\app\services\auth\register.service.js
       create src\main\webapp\app\services\user\user.service.js
       create src\main\webapp\app\services\profiles\profile.service.js
       create src\main\webapp\app\services\profiles\page-ribbon.directive.js
       create src\main\webapp\content\images\hipster.png
       create src\main\webapp\content\images\hipster2x.png
       create src\main\webapp\content\images\logo-jhipster.png
       create src\test\javascript\karma.conf.js
       create src\test\javascript\spec\helpers\module.js
       create src\test\javascript\spec\helpers\httpBackend.js
       create src\test\javascript\spec\app\admin\health\health.controller.spec.js
       create src\test\javascript\spec\app\account\password\password.controller.spec.js
       create src\test\javascript\spec\app\account\password\password-strength-bar.directive.spec.js
       create src\test\javascript\spec\app\account\settings\settings.controller.spec.js
       create src\test\javascript\spec\app\account\activate\activate.controller.spec.js
       create src\test\javascript\spec\app\account\register\register.controller.spec.js
       create src\test\javascript\spec\app\account\reset\finish\reset.finish.controller.spec.js
       create src\test\javascript\spec\app\account\reset\request\reset.request.controller.spec.js
       create src\test\javascript\spec\app\services\auth\auth.services.spec.js
       create src\test\javascript\spec\app\components\login\login.controller.spec.js
       create src\main\webapp\i18n\zh-cn\activate.json
       create src\main\webapp\i18n\zh-cn\audits.json
       create src\main\webapp\i18n\zh-cn\configuration.json
       create src\main\webapp\i18n\zh-cn\error.json
       create src\main\webapp\i18n\zh-cn\gateway.json
       create src\main\webapp\i18n\zh-cn\login.json
       create src\main\webapp\i18n\zh-cn\logs.json
       create src\main\webapp\i18n\zh-cn\home.json
       create src\main\webapp\i18n\zh-cn\metrics.json
       create src\main\webapp\i18n\zh-cn\password.json
       create src\main\webapp\i18n\zh-cn\register.json
       create src\main\webapp\i18n\zh-cn\sessions.json
       create src\main\webapp\i18n\zh-cn\settings.json
       create src\main\webapp\i18n\zh-cn\reset.json
       create src\main\webapp\i18n\zh-cn\user-management.json
       create src\main\webapp\i18n\zh-cn\global.json
       create src\main\webapp\i18n\zh-cn\health.json
       create src\main\resources\i18n\messages_zh_cn.properties
    
    
    I'm all done. Running npm install && bower install for you to install the required dependencies. If this fails, try running the command yourself.
    

    同样需要修改配置并启动项目

    Paste_Image.png

    可以比对一下jHipster的非微服务的项目。
    可以看出管理里面多了些菜单。

    相关文章

      网友评论

      • 卡介仑caption:大佬,我接手一个微服务工程。应该是基于这个开发的,然而原来的人离职了,现在网上资料只找到你这一个。能帮忙讲下uaa这个工程吗?有没有详细文档或资料啥的

      本文标题:jHipster - 微服务搭建

      本文链接:https://www.haomeiwen.com/subject/lrywbttx.html