Jhipster 学习

(一)jhipster构建项目

如何安装jhipster

第一步:下载jdk  自己安装的1.8版本  (安装、环境变量配置略)

第二步:1.下载Eclipse (luna版 eclipse-4.4.1)   

第三步:下载maven (apache-maven-3.2.5)   在eclipse  properties属性里配置setting.xml  ( D:\apache-maven-3.2.5\conf\setting.xml) 因为主要是开发maven项目,setting.xml里主要配置一下jar存放路径和镜像

1
2
3
4
5
6
7
8
<localRepository>D:\m2\repository</localRepository>
 
  <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>       
    </mirror>

第四步:下载Git (官网 https://git-scm.com/download/win  版本 2.16.2.windows.1)  安装完cmd 输入指令 git --version 查看安装版本

Jhipster 学习

 

第五步:下载 node.js     官网(https://nodejs.org/en/)下载最新版本,安装next直到完成。安装node.js 的同时会安装 npm.

安装完毕 WIN+R 打开cmd窗口 输入指令npm 检查npm版本信息 如下:

Jhipster 学习

npm  -v 查看npm版本 5.6.0

node  -v 查看node版本8.11.1

第六步:npm install -g yo

第七步:npm install -g grunt-cli

Jhipster 学习

第八步: npm install -g generator-jhipster

 Jhipster 学习

至此,顺利安装完毕。

其实,还没,忘记安装yarn了。此时可以安装yarn

第九步:安装yarn  输入指令 npm install  -g yarn     指令yarn -v 查看版本 1.5.1

 Jhipster 学习

至此 ,准备工作才算大功告成。

 

如何构建项目

个人喜欢把项目建在F盘  文件夹(jhipster)  F:\jhpster

  cmd 到 F:\jhpste

指令:yo jhipster

 

Jhipster 学习

 

 注意:   此处有Warning failed to connect "git://github.com"   后面给出两个解决方案1》检查网络    2》配置全局替换 

    我尝试了两种都没解决Warning     ping  git://github.com   显示网络超时                    || 不过这个warning 不影响构建项目  继续往后走 ||

? Which *type* of application would you like to create?  (我们要构建microservice application  键盘  ↓  选择Microservice application)如下图

Jhipster 学习

Enter(单击回车键)

Jhipster 学习

 

然后下面一系列问题 根据自己的需求选择 具体如下:(回答完所有问题会自动构建项目)

 

 Jhipster 学习

 生成完毕后 项目结构如下:

 Jhipster 学习

至此,jhipster构建项目结束

 

项目导入

打开Eclipse  import 

Jhipster 学习

 

Jhipster 学习

勾选pom.xml    点击 Finish 按钮 导入架包依赖。因为jar包比较多,初次导入会花费一些时间

 导入中-----

Jhipster 学习

 10分钟后导入完毕(在9%的地方卡了两三分钟,因为是外网,下载速度比较慢)

导入完毕

Jhipster 学习

至此项目才算 结束。暂时告一段落。