jeecgboot 前端环境搭建_JEECG-BOOT环境搭建:2.1.1版

本文档介绍了如何在Mac OS环境下搭建JEECG-BOOT 2.1.1的前端环境。首先,列举了操作系统、MySQL、Redis、Maven、npm等必要的软件版本。接着,详细阐述了从下载代码到启动前端的步骤,包括下载JEECG-BOOT代码、编译后端、创建数据库、启动Redis、启动后端以及编译和启动前端。最后,提供了项目运行的本地URL和相关文档链接。
摘要由CSDN通过智能技术生成

JEECG是一个国内开源的快速开发的J2EE框架,JEECG-BOOT是基于Spring Boot的版本,这篇文章介绍一下搭建的方式(JEECG-BOOT 2.1.1)。

事前准备

操作系统

liumiaocn:~ liumiao$ sw_vers

ProductName:Mac OS X

ProductVersion:10.14

BuildVersion:18A391

liumiaocn:~ liumiao$

1

2

3

4

5

MySQL

liumiaocn:~ liumiao$ mysql --version

mysql Ver 8.0.11 for osx10.13 on x86_64 (Homebrew)

liumiaocn:~ liumiao$

1

2

3

Redis

liumiaocn:~ liumiao$ redis-server --version

Redis server v=5.0.4 sha=00000000:0 malloc=libc bits=64 build=c8feb247a5d1dce2

liumiaocn:~ liumiao$ redis-cli --version

redis-cli 5.0.4

liumiaocn:~ liumiao$

1

2

3

4

5

Maven

liumiaocn:~ liumiao$ mvn --version

Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T02:33:14+08:00)

Maven home: /Library/Maven/apache-maven-3.5.4

Java version: 1.8.0_191, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/jre

Default locale: en_CN, platform encoding: UTF-8

OS name: "mac os x", version: "10.14", arch: "x86_64", family: "mac"

liumiaocn:~ liumiao$

1

2

3

4

5

6

7

npm、node、yarn

liumiaocn:~ liumiao$ npm -v

6.4.1

liumiaocn:~ liumiao$ node -v

v10.15.3

liumiaocn:~ liumiao$ yarn --version

1.15.2

liumiaocn:~ liumiao$

1

2

3

4

5

6

7

整体步骤非常简单,主要分为三步:

下载代码

编译后端、创建数据库并导入数据、启动redis、启动后端

编译前端、启动前端

详细命令以及执行结果和执行日志如下所示:

步骤1: 代码下载

git clone https://github.com/zhangdaiscott/jeecg-boot.git

cd cd jeecg-boot/

注:Angular 版本为 git clone https://gitee.com/dangzhenghui/jeecg-boot,但目前更新很慢

liumiaocn:~ liumiao$ git clone https://github.com/zhangdaiscott/jeecg-boot.git

Cloning into 'jeecg-boot'...

remote: Enumerating objects: 4200, done.

Receiving objects: 76% (3211/4200), 10.49 MiB | 53.00 KiB/s

remote: Total 4200 (delta 0), reused 0 (delta 0), pack-reused 4200

Receiving objects: 100% (4200/4200), 26.10 MiB | 52.00 KiB/s, done.

Resolving deltas: 100% (1975/1975), done.

liumiaocn:~ liumiao$ cd jeecg-boot/

liumiaocn:jeecg-boot liumiao$ ls

LICENSE README.md ant-design-vue-jeecg jeecg-boot

liumiaocn:jeecg-boot liumiao$

1

2

3

4

5

6

7

8

9

10

11

步骤2: 后端环境搭建

步骤1: 编译后端

cd jeecg-boot

mvn package

liumiaocn:jeecg-boot liumiao$ cd jeecg-boot/

liumiaocn:jeecg-boot liumiao$ ls

Dockerfile README.md jeecg-boot-base-common pom.xml

LICENSE db jeecg-boot-module-system

liumiaocn:jeecg-boot liumiao$ ls */target/*.jar

ls: */target/*.jar: No such file or directory

liumiaocn:jeecg-boot liumiao$ mvn clean package

[INFO] Scanning for projects...

...省略

[INFO] ------------------------------------------------------------------------

[INFO] Reactor Summary:

[INFO]

[INFO] jeecg-boot-parent 2.1.1 ............................ SUCCESS [ 0.199 s]

[INFO] jeecg-boot-base-common ............................. SUCCESS [ 5.057 s]

[INFO] jeecg-boot-module-system 2.1.1 ..................... SUCCESS [ 8.113 s]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 13.759 s

[INFO] Finished at: 2019-11-05T20:22:44+08:00

[INFO] ------------------------------------------------------------------------

liumiaocn:jeecg-boot liumiao$ ls */target/*.jar

jeecg-boot-base-common/target/jeecg-boot-base-common-2.1.1.jar

jeecg-boot-module-system/target/jeecg-boot-module-system-2.1.1.jar

liumiaocn:jeecg-boot liumiao$

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

步骤2: 创建数据库

数据库用户名/密码: root/root

mysql -uroot -proot

创建数据库:create database `jeecg-boot` charset utf8mb4;

切换数据库:use jeecg-boot;

导入数据库结构与数据:source 实际目录/jeecg-boot/jeecg-boot/db/jeecg-boot-mysql5.7-20191018.sql;

执行日志如下所示:

liumiaocn:jeecg-boot liumiao$ mysql -uroot -proot

mysql: [Warning] Using a password on the command line interface can be insecure.

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 25

Server version: 8.0.11 Homebrew

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> drop database `jeecg-boot`;

Query OK, 50 rows affected (0.20 sec)

mysql> create database `jeecg-boot` charset utf8mb4;

Query OK, 1 row affected (0.05 sec)

mysql> use jeecg-boot;

Database changed

mysql> source db/jeecg-boot-mysql5.7-20191018.sql;

Query OK, 0 rows affected (0.00 sec)

...省略

Query OK, 1 row affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

mysql>

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

创建之后表信息如下所示

mysql> show tables;

+-------------------------------+

| Tables_in_jeecg-boot |

+-------------------------------+

| demo |

| jeecg_monthly_growth_analysis |

| jeecg_order_customer |

| jeecg_order_main |

| jeecg_order_ticket |

| jeecg_project_nature_income |

| joa_demo |

| onl_cgform_button |

| onl_cgform_enhance_java |

| onl_cgform_enhance_js |

| onl_cgform_enhance_sql |

| onl_cgform_field |

| onl_cgform_head |

| onl_cgform_index |

| oss_file |

| qrtz_blob_triggers |

| qrtz_calendars |

| qrtz_cron_triggers |

| qrtz_fired_triggers |

| qrtz_job_details |

| qrtz_locks |

| qrtz_paused_trigger_grps |

| qrtz_scheduler_state |

| qrtz_simple_triggers |

| qrtz_simprop_triggers |

| qrtz_triggers |

| sys_announcement |

| sys_announcement_send |

| sys_category |

| sys_data_log |

| sys_depart |

| sys_dict |

| sys_dict_item |

| sys_log |

| sys_permission |

| sys_permission_data_rule |

| sys_position |

| sys_quartz_job |

| sys_role |

| sys_role_permission |

| sys_sms |

| sys_sms_template |

| sys_user |

| sys_user_agent |

| sys_user_depart |

| sys_user_role |

| test_demo |

| test_order_main |

| test_order_product |

| test_person |

+-------------------------------+

50 rows in set (0.00 sec)

mysql>

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

步骤3: 启动本地redis服务

redis-server

liumiaocn:jeecg-boot liumiao$ redis-cli info server |grep uptime

uptime_in_seconds:9659

uptime_in_days:0

liumiaocn:jeecg-boot liumiao$

1

2

3

4

步骤4: 后端启动

java -jar jeecg-boot-module-system/target/jeecg-boot-module-system-2.1.1.jar

liumiaocn:jeecg-boot liumiao$ java -jar jeecg-boot-module-system/target/jeecg-boot-module-system-2.1.1.jar

(_) | | | |

_ ___ ___ ___ __ _ ______| |__ ___ ___ | |_

| |/ _ \/ _ \/ __/ _` |______| '_ \ / _ \ / _ \| __|

| | __/ __/ (_| (_| | | |_) | (_) | (_) | |_

| |\___|\___|\___\__, | |_.__/ \___/ \___/ \__|

_/ | __/ |

|__/ |___/

Jeecg Boot Version: 2.1.1

Spring Boot Version: 2.1.3.RELEASE (v2.1.3.RELEASE)

2019-11-05 20:33:27.055 [main] INFO org.jeecg.JeecgApplication:50 - Starting JeecgApplication v2.1.1 on liumiaocn with PID 15189 (/Users/liumiao/jeecg-boot/jeecg-boot/jeecg-boot-module-system/target/jeecg-boot-module-system-2.1.1.jar started by liumiao in /Users/liumiao/jeecg-boot/jeecg-boot)

...省略

2019-11-05 20:33:41.093 [main] INFO org.jeecg.JeecgApplication:26 -

----------------------------------------------------------

Application Jeecg-Boot is running! Access URLs:

Local: http://localhost:8080/jeecg-boot/

External: http://192.168.31.242:8080/jeecg-boot/

swagger-ui: http://192.168.31.242:8080/jeecg-boot/swagger-ui.html

Doc: http://192.168.31.242:8080/jeecg-boot/doc.html

----------------------------------------------------------

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

项目链接

Local

http://localhost:8080/jeecg-boot/

swagger-ui

http://localhost:8080/jeecg-boot/swagger-ui.html

Doc

http://localhost:8080/jeecg-boot/doc.html

Druid

http://localhost:8080/jeecg-boot/druid

Local/Doc

swagger-ui

Druid

注:用户名/密码为admin/123456

至此可以看到后端已经编译完毕,而且服务后也进行了上述页面的确认。

步骤3: 前端环境搭建

步骤1: 编译前端

cd ant-design-vue-jeecg/

yarn install

liumiaocn:ant-design-vue-jeecg liumiao$ yarn install

yarn install v1.15.2

warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.

[1/4] 🔍 Resolving packages...

[2/4] 🚚 Fetching packages...

[3/4] 🔗 Linking dependencies...

warning " > vue-loader@15.7.1" has unmet peer dependency "css-loader@*".

warning " > vue-loader@15.7.1" has unmet peer dependency "webpack@^4.1.0 || ^5.0.0-0".

warning " > less-loader@4.1.0" has unmet peer dependency "webpack@^2.0.0 || ^3.0.0 || ^4.0.0".

warning " > sass-loader@7.3.1" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".

[4/4] 🔨 Building fresh packages...

success Saved lockfile.

✨ Done in 36.64s.

liumiaocn:ant-design-vue-jeecg liumiao$

1

2

3

4

5

6

7

8

9

10

11

12

13

14

步骤2: 启动服务

npm run serve

liumiaocn:ant-design-vue-jeecg liumiao$ npm run serve

> vue-antd-jeecg@2.1.1 serve /Users/liumiao/jeecg-boot/ant-design-vue-jeecg

> vue-cli-service serve

INFO Starting development server...

98% after emitting CopyPlugin

DONE Compiled successfully in 30514ms 8:49:52 PM

App running at:

- Local: http://localhost:3000/

- Network: http://192.168.31.242:3000/

Note that the development build is not optimized.

To create a production build, run yarn build.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

输入用户名、密码和验证码后即可登录使用了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值