Commit ccbdb6b09a6aef7c4861a2039e813c922d94bd9b

Authored by zhangdaiscott
1 parent e531ab6e

升级:简化微服务切换步骤,增加profile模式 SpringCloud,快速切换微服务

修改记录:
jeecg-cloud-module/jeecg-cloud-system-start/pom.xml
pom.xml
jeecg-boot-module-system/pom.xml
jeecg-boot-module-demo/pom.xml
jeecg-boot/jeecg-boot-module-demo/pom.xml
... ... @@ -16,14 +16,19 @@
16 16 <groupId>org.jeecgframework.boot</groupId>
17 17 <artifactId>jeecg-boot-base-core</artifactId>
18 18 </dependency>
19   - <!--引入微服务启动依赖 starter
20   - <dependency>
21   - <groupId>org.jeecgframework.boot</groupId>
22   - <artifactId>jeecg-boot-starter-cloud</artifactId>
23   - </dependency>
24   - <dependency>
25   - <groupId>org.jeecgframework.boot</groupId>
26   - <artifactId>jeecg-boot-starter-job</artifactId>
27   - </dependency>-->
28 19 </dependencies>
  20 +
  21 + <profiles>
  22 + <profile>
  23 + <id>SpringCloud</id>
  24 + <!-- 引入微服务启动 Starter依赖 -->
  25 + <dependencies>
  26 + <dependency>
  27 + <groupId>org.jeecgframework.boot</groupId>
  28 + <artifactId>jeecg-boot-starter-cloud</artifactId>
  29 + </dependency>
  30 + </dependencies>
  31 + </profile>
  32 + </profiles>
  33 +
29 34 </project>
30 35 \ No newline at end of file
... ...
jeecg-boot/jeecg-boot-module-system/pom.xml
... ... @@ -54,7 +54,7 @@
54 54 <dependency>
55 55 <groupId>org.jeecgframework.jimureport</groupId>
56 56 <artifactId>jimureport-spring-boot-starter</artifactId>
57   - <version>1.4.32</version>
  57 + <version>1.4.4-beta</version>
58 58 </dependency>
59 59  
60 60  
... ... @@ -73,8 +73,8 @@
73 73 <groupId>org.springframework.boot</groupId>
74 74 <artifactId>spring-boot-maven-plugin</artifactId>
75 75 <configuration>
76   - <!--微服务模式下修改为true,跳过此打包插件,否则微服务模块无法引用-->
77   - <skip>false</skip>
  76 + <!--微服务模式下修改为true,跳过SpringBoot启动打包插件,否则微服务模块无法引用-->
  77 + <skip>${skip.springboot.maven}</skip>
78 78 </configuration>
79 79 </plugin>
80 80 </plugins>
... ...
jeecg-boot/jeecg-cloud-module/jeecg-cloud-system-start/pom.xml
... ... @@ -28,6 +28,13 @@
28 28 <dependency>
29 29 <groupId>org.jeecgframework.boot</groupId>
30 30 <artifactId>jeecg-boot-module-system</artifactId>
  31 + <!-- 排除demo模块,demo模块采用微服务方式独立启动 -->
  32 + <exclusions>
  33 + <exclusion>
  34 + <groupId>org.jeecgframework.boot</groupId>
  35 + <artifactId>jeecg-boot-module-demo</artifactId>
  36 + </exclusion>
  37 + </exclusions>
31 38 </dependency>
32 39  
33 40 <!-- 测试模块依赖 -->
... ...
jeecg-boot/pom.xml
... ... @@ -4,6 +4,7 @@
4 4 <artifactId>jeecg-boot-parent</artifactId>
5 5 <version>3.1.0</version>
6 6 <packaging>pom</packaging>
  7 + <name>JEECG BOOT ${project.version}</name>
7 8  
8 9 <parent>
9 10 <groupId>org.springframework.boot</groupId>
... ... @@ -14,6 +15,8 @@
14 15  
15 16 <properties>
16 17 <jeecgboot.version>3.1.0</jeecgboot.version>
  18 + <!-- 微服务专用属性 -->
  19 + <skip.springboot.maven>false</skip.springboot.maven>
17 20 <java.version>1.8</java.version>
18 21 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
19 22 <spring-cloud.version>Hoxton.SR8</spring-cloud.version>
... ... @@ -56,9 +59,6 @@
56 59 <module>jeecg-boot-base</module>
57 60 <module>jeecg-boot-module-demo</module>
58 61 <module>jeecg-boot-module-system</module>
59   - <!--需要微服务,请打开
60   - <module>jeecg-boot-starter</module>
61   - <module>jeecg-cloud-module</module>-->
62 62 </modules>
63 63  
64 64 <distributionManagement>
... ... @@ -296,11 +296,7 @@
296 296  
297 297 <build>
298 298 <plugins>
299   - <!--<plugin>
300   - <groupId>org.springframework.boot</groupId>
301   - <artifactId>spring-boot-maven-plugin</artifactId>
302   - </plugin>
303   - 指定JDK编译版本 -->
  299 + <!-- 指定JDK编译版本 -->
304 300 <plugin>
305 301 <groupId>org.apache.maven.plugins</groupId>
306 302 <artifactId>maven-compiler-plugin</artifactId>
... ... @@ -420,5 +416,18 @@
420 416 <discovery.server-addr>jeecg-boot-nacos:8848</discovery.server-addr>
421 417 </properties>
422 418 </profile>
  419 + <!-- SpringCloud运行环境 -->
  420 + <profile>
  421 + <id>SpringCloud</id>
  422 + <properties>
  423 + <!--微服务模式下修改为true, system模块跳过打包插件,否则微服务无法引用-->
  424 + <skip.springboot.maven>true</skip.springboot.maven>
  425 + </properties>
  426 + <modules>
  427 + <!-- 微服务模块 -->
  428 + <module>jeecg-boot-starter</module>
  429 + <module>jeecg-cloud-module</module>
  430 + </modules>
  431 + </profile>
423 432 </profiles>
424 433 </project>
425 434 \ No newline at end of file
... ...