美文网首页
win7下安装jhipster

win7下安装jhipster

作者: 我是嘻哈大哥 | 来源:发表于2018-09-24 15:59 被阅读49次

    1.首先安装Node和yarn、git,下载安装包安装就可以



    2.安装后验证如下:


    3.设置缓存路径
    (1)设置npm

    npm  config set cache 路径
    npm  config set prefix 路径
    

    设置完成后可以查看



    (2)设置yarn

    yarn config set cache-folder 路径
    

    同理可以通过命令查看

    yarn config get cache-folder
    

    4.安装yo

    npm -install -g yo
    

    5、安装jhipster

    yarn global add generator-jhipster
    

    6、验证安装是否成功

    yo jhipster
    

    显示结果如下:



    7.Jhipster创建应用时的问题,你选择的问题答案不同可能会影响到接下来的问题显示:

    Q1. Which type of application would you like to create?
    

    Monolithic application: 单体应用
    Microservice application: 微服务架构的service
    Microservice gateway: 微服务网关,为微服务请求进行路由和安全
    JHipster UAA server: 基于OAuth2的安全认证微服务,后文详细解释

    Q2. What is the base name of your application?
    

    你期望的应用的名称

    Q3. What is your default Java package name?
    

    应用使用的默认包名,使用Yeoman的时候此值会被存储,当下次使用的时候此值会成为默认值,可覆写此值

    Q4. Do you want to use the JHipster Registry to configure, monitor and scale your application?
    

    JHipster Registry是一个开源的工具,用于管理你正在运行的应用(微服务注册中心和统一配置中心),只有在微服务架构时才会使用

    Q5. Which type of authentication would you like to use?
    

    JWT authentication: 使用JSON Web Token
    HTTP Session Authentication:经典的基于session认证的机制
    OAuth 2.0 / OIDC Authentication: 使用OpenID连接服务,类似于Keycloak或者Okta
    Authentication with JHipster UAA server: 此种方式必须提前生成JHipster UAA Server (Q1的选项),它是基于OAuth2的验证服务

    Q6. Which type of database would you like to use?
    

    No database,仅使用微服务架构时可用
    An SQL database: 使用关系型数据库,将会采用Spring data jpa
    MongoDB
    Cassandra
    Couchbase

    Q7. Which production database would you like to use?
    

    选择你线上环境使用的数据库,此选项决定
    src/main/resources/config/application-prod.yml的配置

    Q8. Which development database would you like to use?
    

    此选项决定你src/main/resources/config/application-dev.ymlprofile的数据库配置项,你可以选择:
    H2,running in-memory,数据存储在内存中,服务停掉数据消失H2,with its data stored on disk,数据存储在硬盘,当前只是BETA测试且不能Windows机器上工作可以和Q7的选项一致

    Q9. Do you want to use the Spring cache abstraction?
    

    由于Spring对于Cache的允许用户使用不同的cache实现,你可以使用chcache(本地缓存),Hazelcast(分布式缓存)或者Infinispan(另一种分布式缓存),此选项可以提升你的应用的性能

    Q10. Do you want to use Hibernate 2nd level cache?
    

    此选项仅当你选择SQL数据库并且在Q9选择了一个缓存实现。Hibernate使用二级缓存可以更好的提升它的性能

    Q11. Would you like to use Maven or Gradle?
    

    构建此项目时将要使用的工具,Maven或者Gradle

    Q12. Which other technologies would you like to use?
    

    多选,你可以为你的应用添加多种技术,如:
    Social login,社交登录功能
    API first development using swagger-codegen:通过成swagger-codegen而使你的应用采用API优先的开发模式
    Search engine using ElasticSearch: 对于ES的支持(Spring Data Elasticsearch)
    Clustered HTTP sessions using Hazelcast,默认情况下,JHipster只是用Http Session来存储Spring Security的身份验证和授权信息。如果你在集群中运行,使用HTTP Session将会导致一些数据一致的问题,如果你想在集群中复制session,请选择此项

    Q13. WebSockets using Spring Websocket
    

    启用Websockets支持,将使用Spring WebSocket,JHipster提供了简单的例子展示如和高效的使用

    Q14. Asynchronous messages using Apache Kafka
    

    是否使用Kafka来发布和订阅消息

    Q15. Which Framework would you like to use for the client?
    

    选择使用那种客户端技术:
    Angular version 4+
    AngularJS version 1.x

    Q16. Would you like to use the LibSass stylesheet preprocessor for your CSS?
    

    Node-sass对于设计CSS是一个优秀的解决方案,便于高效使用,你需要运行一个Gulp服务,jhipster会自动配置

    Q17. Would you like to enable internationalization support?
    

    JHipster对于国际支持非常友好,你可以在客户端和服务端使用。但一般对于国际化要求不多的场景,可以不选择。

    Q18. Which testing frameworks would you like to use?
    

    默认Jhipster提供了Java单元/集成测试(spring`s Junit)和JavaScript单元测试(Karma.js),你也可以选择:

    Performance tests using Gatling,性能测试 Gatling
    Behaviour tests using Cucumber,行为测试 Cucumber
    Angular integration tests with Protractor, angular集成测试Protractor

    Q19. Would you like to install other generators from the JHipster Marketplace?
    

    是否需要去JHipster商城安装第三方插件模块

    相关文章

      网友评论

          本文标题:win7下安装jhipster

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