从一个简单应用开始,先通过Jhipster创建一个简单的web应用。
1、用管理员角色打开cmd命令行,进入到自己需要创建应用的路径(注意:需要在新建的文件夹里面);
2、输入【jhipster】命令,开始创建web应用;
3、通过向导式的问题一步步完成web应用的创建(下面用红色标出选择);
Which type of application would you like to create?(你想创建哪种类型的应用?)
4、由于我们是创建简单的web应用,选择【Monolithic application】,然后继续;
What is the base name of your application?(应用程序的基本名称是什么?)
What is your default Java package name?(默认的java包名称应用程序的基本名称是什么?)
Do you want to use the JHipster Registry to configure, monitor and scale your application?(是否需要使用注册配置中心来扩展应用)
Which type of authentication would you like to use?(你想选择哪种认证方式)
8、根据实际情况选用即可,本次选用JWT回车继续;
Which type of database would you like to use?(选用数据库类型)
9、选择【SQL】回车继续;
Which production database would you like to use?(你想用哪种数据库产品)
10、选择【MYSQL】回车继续;
Which development database would you like to use?(你想用哪种开发数据?)
11、选择【MYSQL】回车继续;
Do you want to use the Spring cache abstraction?(你想用spring的抽象缓存吗?)
12、本次选择【NO】回车继续;
Would you like to use Maven or Gradle?(构建工具选择)
13、根据实际情况,默认使用Maven进行构建;
Which other technologies would you like to use?(其他技术选择)
14、本次不选择其他技术,直接回车继续;
Which Framework would you like to use for the client?(前端框架选择)
15、根据实际情况选择,本次选择【Angular 6】回车继续;
Would you like to use the LibSass stylesheet preprocessor for your CSS?(你想为你的CSS使用LibSass样式表预处理器吗?)
16、默认为【N】回车继续;
Would you like to enable internationalization support?(你想开启国际化支持吗?)
17、默认为【Y】,输入【N】回车继续;
Which testing frameworks would you like to use?(测试框架选择)
18、本次不选用,回车继续;
Would you like to install other generators from the JHipster Marketplace?(是否启用JHipster 市场)
19、默认为【N】,回车继续;
20、回答完以上问题,Jhipster开始自动生成构建项目;
21、简单项目创建完成;
1、将创建的项目导入到eclipse;
2、在项目上右键,Project -> Properties -> Resource -> Resource Filters,选择【Exclude all】, 在【Applies to 】选中【folders】, Name matches 输入【node_modules】,点击OK;
3、点击菜单【Help】,选中【Eclipse Marketplace】,输入【jhipster】,点击【install】安装jhipster插件;1、修改【/simple-app/src/main/resources/config/application-dev.yml】配置文件,将【spring.datasource】改为正确的数据库配置(默认激活dev配置);
2、在Eclipse找到类【/simple-app/src/main/java/com/jhipster/SimpleApp.java】,右键【run->java application】;
3、使用管理员打开cmd命令行,进入到工程路径然后输入:【yarn start】,启动前端应用;
4、打开浏览器,输入【http://localhost:9000】,通过:admin/admin账号登陆。由于没有生成任何对象实体,所以只有相关的监控信息;
5、工程启动成功;