美文网首页JHipsterjHipster
jHipster - 第一个项目

jHipster - 第一个项目

作者: CC_简书 | 来源:发表于2016-12-22 16:47 被阅读297次

    依赖环境

    • jHipster
    • Maven 或 Gradle
    • Mysql
    • Eclipse, Intellij IDEA, 其中一个

    创建项目

    Step 1 创建目录

    # 进入存放项目的目录
    cd c:/ws
    # 创建项目文件夹
    mkdir demo
    cd demo
    # 引导jHipster
    yo jhipster
    

    (以下是萤幕上显示出来的,引导jHipster后会有13个选项需要录入)

    c:\ws\demo>yo jhipster
    
            ██  ██    ██  ████████  ███████    ██████  ████████  ████████  ███████
            ██  ██    ██     ██     ██    ██  ██          ██     ██        ██    ██
            ██  ████████     ██     ███████    █████      ██     ██████    ███████
      ██    ██  ██    ██     ██     ██             ██     ██     ██        ██   ██
       ██████   ██    ██  ████████  ██        ██████      ██     ████████  ██    ██
    
                                http://jhipster.github.io
    
    Welcome to the JHipster Generator v3.9.1
    Documentation for creating an application: https://jhipster.github.io/creating-an-app/
    Application files will be generated in folder: c:\ws\demo
     ______________________________________________________________________________
    
      JHipster update available: 3.12.2 (current: 3.9.1)
      Run npm install -g generator-jhipster to update.
     ______________________________________________________________________________
    
    ? (1/13) Which *type* of application would you like to create? Monolithic application (recommended for simple projects)
    ? (2/13) What is the base name of your application? demo
    ? (3/13) What is your default Java package name? cn.ctodb.demo
    ? (4/13) Which *type* of authentication would you like to use? HTTP Session Authentication (stateful, default Spring Security mechanism)
    ? (5/13) Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle)
    ? (6/13) Which *production* database would you like to use? MySQL
    ? (7/13) Which *development* database would you like to use? H2 with disk-based persistence
    ? (8/13) Do you want to use Hibernate 2nd level cache? Yes, with ehcache (local cache, for a single node)
    ? (9/13) Would you like to use Maven or Gradle for building the backend? Maven
    ? (10/13) Which other technologies would you like to use? (Press <space> to select, <a> to toggle all, <i> to inverse selection)
    ? (11/13) Would you like to use the LibSass stylesheet preprocessor for your CSS? No
    ? (12/13) 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/13) Which testing frameworks would you like to use? (Press <space> to select, <a> to toggle all, <i> to inverse selection)Gatling
    

    选完所有选项后会自动生成一下内容(通过nodejs/git下载一些程序文件)

    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\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\resources\ehcache.xml
       create src\main\resources\.h2.server.properties
       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\demo\security\SpringSecurityAuditorAware.java
       create src\main\java\cn\ctodb\demo\security\SecurityUtils.java
       create src\main\java\cn\ctodb\demo\security\AuthoritiesConstants.java
       create src\main\java\cn\ctodb\demo\config\SecurityConfiguration.java
       create src\main\java\cn\ctodb\demo\domain\PersistentToken.java
       create src\main\java\cn\ctodb\demo\repository\PersistentTokenRepository.java
       create src\main\java\cn\ctodb\demo\security\Http401UnauthorizedEntryPoint.java
       create src\main\java\cn\ctodb\demo\security\UserDetailsService.java
       create src\main\java\cn\ctodb\demo\security\UserNotActivatedException.java
       create src\main\java\cn\ctodb\demo\security\package-info.java
       create src\main\java\cn\ctodb\demo\security\AjaxAuthenticationFailureHandler.java
       create src\main\java\cn\ctodb\demo\security\AjaxAuthenticationSuccessHandler.java
       create src\main\java\cn\ctodb\demo\security\AjaxLogoutSuccessHandler.java
       create src\main\java\cn\ctodb\demo\security\CustomAccessDeniedHandler.java
       create src\main\java\cn\ctodb\demo\security\CustomPersistentRememberMeServices.java
       create src\main\java\cn\ctodb\demo\web\filter\CsrfCookieGeneratorFilter.java
       create src\main\java\cn\ctodb\demo\DemoApp.java
       create src\main\java\cn\ctodb\demo\ApplicationWebXml.java
       create src\main\java\cn\ctodb\demo\aop\logging\LoggingAspect.java
       create src\main\java\cn\ctodb\demo\config\DefaultProfileUtil.java
       create src\main\java\cn\ctodb\demo\config\apidoc\package-info.java
       create src\main\java\cn\ctodb\demo\config\apidoc\SwaggerConfiguration.java
       create src\main\java\cn\ctodb\demo\config\apidoc\PageableParameterBuilderPlugin.java
       create src\main\java\cn\ctodb\demo\async\package-info.java
       create src\main\java\cn\ctodb\demo\async\ExceptionHandlingAsyncTaskExecutor.java
       create src\main\java\cn\ctodb\demo\config\package-info.java
       create src\main\java\cn\ctodb\demo\config\AsyncConfiguration.java
       create src\main\java\cn\ctodb\demo\config\CacheConfiguration.java
       create src\main\java\cn\ctodb\demo\config\Constants.java
       create src\main\java\cn\ctodb\demo\config\LoggingConfiguration.java
       create src\main\java\cn\ctodb\demo\config\CloudDatabaseConfiguration.java
       create src\main\java\cn\ctodb\demo\config\DatabaseConfiguration.java
       create src\main\java\cn\ctodb\demo\config\audit\package-info.java
       create src\main\java\cn\ctodb\demo\config\audit\AuditEventConverter.java
       create src\main\java\cn\ctodb\demo\config\JHipsterProperties.java
       create src\main\java\cn\ctodb\demo\config\LocaleConfiguration.java
       create src\main\java\cn\ctodb\demo\config\LoggingAspectConfiguration.java
       create src\main\java\cn\ctodb\demo\config\MetricsConfiguration.java
       create src\main\java\cn\ctodb\demo\config\ThymeleafConfiguration.java
       create src\main\java\cn\ctodb\demo\config\WebConfigurer.java
       create src\main\java\cn\ctodb\demo\config\locale\package-info.java
       create src\main\java\cn\ctodb\demo\config\locale\AngularCookieLocaleResolver.java
       create src\main\java\cn\ctodb\demo\config\liquibase\AsyncSpringLiquibase.java
       create src\main\java\cn\ctodb\demo\config\liquibase\package-info.java
       create src\main\java\cn\ctodb\demo\domain\package-info.java
       create src\main\java\cn\ctodb\demo\domain\util\JSR310DateConverters.java
       create src\main\java\cn\ctodb\demo\domain\util\JSR310PersistenceConverters.java
       create src\main\java\cn\ctodb\demo\domain\util\FixedH2Dialect.java
       create src\main\java\cn\ctodb\demo\domain\AbstractAuditingEntity.java
       create src\main\java\cn\ctodb\demo\domain\PersistentAuditEvent.java
       create src\main\java\cn\ctodb\demo\repository\package-info.java
       create src\main\java\cn\ctodb\demo\service\package-info.java
       create src\main\java\cn\ctodb\demo\service\util\RandomUtil.java
       create src\main\java\cn\ctodb\demo\web\rest\errors\ErrorConstants.java
       create src\main\java\cn\ctodb\demo\web\rest\errors\CustomParameterizedException.java
       create src\main\java\cn\ctodb\demo\web\rest\errors\ErrorVM.java
       create src\main\java\cn\ctodb\demo\web\rest\errors\ExceptionTranslator.java
       create src\main\java\cn\ctodb\demo\web\rest\errors\FieldErrorVM.java
       create src\main\java\cn\ctodb\demo\web\rest\errors\ParameterizedErrorVM.java
       create src\main\java\cn\ctodb\demo\web\filter\package-info.java
       create src\main\java\cn\ctodb\demo\web\filter\CachingHttpHeadersFilter.java
       create src\main\java\cn\ctodb\demo\web\rest\vm\package-info.java
       create src\main\java\cn\ctodb\demo\web\rest\vm\LoggerVM.java
       create src\main\java\cn\ctodb\demo\web\rest\util\HeaderUtil.java
       create src\main\java\cn\ctodb\demo\web\rest\util\PaginationUtil.java
       create src\main\java\cn\ctodb\demo\web\rest\package-info.java
       create src\main\java\cn\ctodb\demo\web\rest\LogsResource.java
       create src\main\java\cn\ctodb\demo\web\rest\ProfileInfoResource.java
       create src\test\java\cn\ctodb\demo\web\rest\TestUtil.java
       create src\test\resources\config\application.yml
       create src\test\resources\logback-test.xml
       create src\test\resources\ehcache.xml
       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\demo\domain\User.java
       create src\main\java\cn\ctodb\demo\domain\Authority.java
       create src\main\java\cn\ctodb\demo\repository\CustomAuditEventRepository.java
       create src\main\java\cn\ctodb\demo\repository\AuthorityRepository.java
       create src\main\java\cn\ctodb\demo\repository\PersistenceAuditEventRepository.java
       create src\main\java\cn\ctodb\demo\repository\UserRepository.java
       create src\main\java\cn\ctodb\demo\service\UserService.java
       create src\main\java\cn\ctodb\demo\service\MailService.java
       create src\main\java\cn\ctodb\demo\service\AuditEventService.java
       create src\main\java\cn\ctodb\demo\service\dto\package-info.java
       create src\main\java\cn\ctodb\demo\service\dto\UserDTO.java
       create src\main\java\cn\ctodb\demo\web\rest\vm\ManagedUserVM.java
       create src\main\java\cn\ctodb\demo\web\rest\UserResource.java
       create src\main\java\cn\ctodb\demo\web\rest\AccountResource.java
       create src\main\java\cn\ctodb\demo\web\rest\vm\KeyAndPasswordVM.java
       create src\main\java\cn\ctodb\demo\service\mapper\package-info.java
       create src\main\java\cn\ctodb\demo\service\mapper\UserMapper.java
       create src\main\java\cn\ctodb\demo\web\rest\AuditResource.java
       create src\test\java\cn\ctodb\demo\service\UserServiceIntTest.java
       create src\test\java\cn\ctodb\demo\web\rest\UserResourceIntTest.java
       create src\test\java\cn\ctodb\demo\web\rest\AccountResourceIntTest.java
       create src\test\java\cn\ctodb\demo\security\SecurityUtilsUnitTest.java
       create src\test\java\cn\ctodb\demo\web\rest\AuditResourceIntTest.java
       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\sessions\sessions.html
       create src\main\webapp\app\account\sessions\sessions.state.js
       create src\main\webapp\app\account\sessions\sessions.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\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-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-link.directive.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.session.service.js
       create src\main\webapp\app\services\auth\sessions.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\test\javascript\spec\app\account\sessions\sessions.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.
    。。。 由于内容过长不做全部展示
    

    如果网络通畅,不会出现问题,建立该应用程式不超过30分钟。
    如果出现异常退出,则可以再输入以下指令:

    npm install
    bower install
    gulp install
    

    一个全新的jHipster项目就被创建生成了。
    然后就可以通过mvn、java、或者开发工具等进行项目编译和启动

    相关文章

      网友评论

        本文标题:jHipster - 第一个项目

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