前提条件:
(1)安装了jdk8 (2)安装了node10 (3)安装了JHipster
验证方式如下:
详细步骤如下:
1、打开CMD,在D盘创建一个文件,然后开始创建JHipster应用
C:\Users\PC-8813>d:
D:\>mkdir JHipsterDemo
D:\>cd JHipsterDemo
D:\JHipsterDemo>jhipster
2、选择创建Monolithic application应用:Monolithic application
? Which *type* of application would you like to create? Monolithic application (recommended for simple projects)
3、为创建的应用设置一个名称:JHipsterDemo
? What is the base name of your application? JHipsterDemo
4、为包名设置一个名称:org.jhipster.test
? What is your default Java package name? org.jhipster.test
5、选择是否配置注册中心到应用中:NO
? Do you want to use the JHipster Registry to configure, monitor and scale your application? No
6、选择想要使用的认证类型:JWT
? Which *type* of authentication would you like to use? JWT authentication (stateless, with a token)
7、选择想要使用的数据库工具:MYSQL
? Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle, MSSQL)
? Which *production* database would you like to use? MySQL
8、选择想要使用的开发数据库:H2 with disk-based persistence
? Which *development* database would you like to use? H2 with disk-based persistence
9、选择是否使用Spring的缓存机制:YES
? Do you want to use the Spring cache abstraction? Yes, with the Ehcache implementation (local cache, for a single node)
10、选择是否使用Hibernate的 二级缓存:YES
? Do you want to use Hibernate 2nd level cache? Yes
11、选择后端的搭建工具:MAVEN
? Would you like to use Maven or Gradle for building the backend? Maven
12、选择想要的其他技术:直接按Enter键,一个都不选择
? Which *Framework* would you like to use for the client? (Use arrow keys)
13、选择想要使用的前端框架:Angular
? Which *Framework* would you like to use for the client? Angular
14、选择应用的主题:Default JHipster
? Would you like to use a Bootswatch theme (https://bootswatch.com/)? Default JHipster
15、选择是否需要国际化:YES
? Would you like to enable internationalization support? Yes
16、选择母语:Chinese
? Please choose the native language of the application Chinese (Simplified)
17、选择需要安装的其他语言:English
? Please choose additional languages to install English
18、选择想要使用的其他测试框架:不选择
? Besides JUnit and Jest, which testing frameworks would you like to use?
19、选择是否想要安装的其他生成器:NO
? Would you like to install other generators from the JHipster Marketplace? No
选择完之后,就会逐渐产生一个项目
20、创建完成:
21、启动项目:mvnw (./mvnw (on Mac OS X/Linux) mvnw (on Windows))
开发机器不需要安装Maven,因为JHipster提供了一个Maven Wrapper,所以:
./mvnw (on Mac OS X/Linux)
mvnw (on Windows)
上面的命令行,相当于运行了:
spring-boot:run
如果运行产品模式:
./mvnw -Pprod (on Mac OS X/Linux)
mvnw -Pprod (on Windows)
如果你本机安装了Maven,上面的./mvnw和mvnw可以换成mvn。
验证maven是否安装:mvn -version
22、启动成功:
23、使用浏览器访问地址,效果如下:
http://localhost:8080
登录之后,可以看到其中的一些信息,简单的应用就已经搭建完成了