4.5、模块依赖
tanhua
1. <properties> 2. <maven.compiler.source>8</maven.compiler.source> 3. <maven.compiler.target>8</maven.compiler.target> 4. <mysql.version>5.1.47</mysql.version> 5. <jackson.version>2.11.0</jackson.version> 6. <druid.version>1.0.9</druid.version> 7. <servlet-api.version>2.5</servlet-api.version> 8. <jsp-api.version>2.0</jsp-api.version> 9. <joda-time.version>2.5</joda-time.version> 10. <commons-lang3.version>3.3.2</commons-lang3.version> 11. <commons-io.version>1.3.2</commons-io.version> 12. <mybatis.version>3.5.6</mybatis.version> 13. <mybatis.mybatis-plus>3.4.1</mybatis.mybatis-plus> 14. <lombok.version>1.18.8</lombok.version> 15. <mongo.version>4.0.5</mongo.version> 16. <spring-cloud.version>Hoxton.SR10</spring-cloud.version> 17. <spring-cloud-alibaba.version>2.2.5.RELEASE</spring-cloud-alibaba.version> 18. </properties> 19. 20. <!--通用依赖--> 21. <dependencies> 22. <dependency> 23. <groupId>org.springframework.boot</groupId> 24. <artifactId>spring-boot-starter-test</artifactId> 25. <scope>test</scope> 26. </dependency> 27. <dependency> 28. <groupId>junit</groupId> 29. <artifactId>junit</artifactId> 30. <version>4.12</version> 31. <scope>test</scope> 32. </dependency> 33. <dependency> 34. <groupId>org.projectlombok</groupId> 35. <artifactId>lombok</artifactId> 36. </dependency> 37. <dependency> 38. <groupId>cn.hutool</groupId> 39. <artifactId>hutool-all</artifactId> 40. <version>5.4.3</version> 41. </dependency> 42. <dependency> 43. <groupId>com.alibaba</groupId> 44. <artifactId>fastjson</artifactId> 45. <version>1.2.8</version> 46. </dependency> 47. </dependencies> 48. 49. <dependencyManagement> 50. <dependencies> 51. <dependency> 52. <groupId>io.netty</groupId> 53. <artifactId>netty-bom</artifactId> 54. <version>4.1.59.Final</version> 55. <type>pom</type> 56. <scope>import</scope> 57. </dependency> 58. 59. <dependency> 60. <groupId>io.projectreactor</groupId> 61. <artifactId>reactor-bom</artifactId> 62. <version>2020.0.4</version> 63. <type>pom</type> 64. <scope>import</scope> 65. </dependency> 66. 67. <dependency> 68. <groupId>io.projectreactor.netty</groupId> 69. <artifactId>reactor-netty</artifactId> 70. <version>0.9.8.RELEASE</version> 71. </dependency> 72. 73. <dependency> 74. <groupId>org.springframework.cloud</groupId> 75. <artifactId>spring-cloud-dependencies</artifactId> 76. <version>${spring-cloud.version}</version> 77. <type>pom</type> 78. <scope>import</scope> 79. </dependency> 80. 81. <dependency> 82. <groupId>com.alibaba.cloud</groupId> 83. <artifactId>spring-cloud-alibaba-dependencies</artifactId> 84. <version>${spring-cloud-alibaba.version}</version> 85. <type>pom</type> 86. <scope>import</scope> 87. </dependency> 88. 89. <dependency> 90. <groupId>joda-time</groupId> 91. <artifactId>joda-time</artifactId> 92. <version>${joda-time.version}</version> 93. </dependency> 94. 95. <!-- mybatis-plus插件依赖 --> 96. <dependency> 97. <groupId>com.baomidou</groupId> 98. <artifactId>mybatis-plus</artifactId> 99. <version>${mybatis.mybatis-plus}</version> 100. </dependency> 101. 102. <!-- MySql --> 103. <dependency> 104. <groupId>mysql</groupId> 105. <artifactId>mysql-connector-java</artifactId> 106. <version>${mysql.version}</version> 107. </dependency> 108. 109. <dependency> 110. <groupId>org.mongodb</groupId> 111. <artifactId>mongodb-driver-sync</artifactId> 112. <version>${mongodb.version}</version> 113. </dependency> 114. 115. <dependency> 116. <groupId>org.projectlombok</groupId> 117. <artifactId>lombok</artifactId> 118. <optional>true</optional> 119. <version>${lombok.version}</version> 120. </dependency> 121. 122. <dependency> 123. <groupId>org.apache.commons</groupId> 124. <artifactId>commons-lang3</artifactId> 125. <version>${commons-lang3.version}</version> 126. </dependency> 127. 128. <dependency> 129. <groupId>org.apache.commons</groupId> 130. <artifactId>commons-lang3</artifactId> 131. <version>3.7</version> 132. </dependency> 133. <!-- Jackson Json处理工具包 --> 134. <dependency> 135. <groupId>com.fasterxml.jackson.core</groupId> 136. <artifactId>jackson-databind</artifactId> 137. <version>${jackson.version}</version> 138. </dependency> 139. <dependency> 140. <groupId>com.alibaba</groupId> 141. <artifactId>druid</artifactId> 142. <version>${druid.version}</version> 143. </dependency> 144. <dependency> 145. <groupId>commons-codec</groupId> 146. <artifactId>commons-codec</artifactId> 147. <version>1.11</version> 148. </dependency> 149. </dependencies> 150. </dependencyManagement> 151. 152. <build> 153. <plugins> 154. <!-- java编译插件 --> 155. <plugin> 156. <groupId>org.apache.maven.plugins</groupId> 157. <artifactId>maven-compiler-plugin</artifactId> 158. <version>3.2</version> 159. <configuration> 160. <source>1.8</source> 161. <target>1.8</target> 162. <encoding>UTF-8</encoding> 163. </configuration> 164. </plugin> 165. </plugins> 166. </build>
tanhua-app-server
1. <dependencies> 2. 3. <dependency> 4. <groupId>org.springframework.boot</groupId> 5. <artifactId>spring-boot-starter-web</artifactId> 6. </dependency> 7. 8. <!--SpringDataRedis依赖--> 9. <dependency> 10. <groupId>org.springframework.boot</groupId> 11. <artifactId>spring-boot-starter-data-redis</artifactId> 12. </dependency> 13. 14. <!--lombok依赖--> 15. <dependency> 16. <groupId>org.projectlombok</groupId> 17. <artifactId>lombok</artifactId> 18. </dependency> 19. 20. <!--工具包--> 21. <dependency> 22. <groupId>org.apache.commons</groupId> 23. <artifactId>commons-lang3</artifactId> 24. </dependency> 25. <dependency> 26. <groupId>com.fasterxml.jackson.core</groupId> 27. <artifactId>jackson-databind</artifactId> 28. </dependency> 29. <dependency> 30. <groupId>commons-codec</groupId> 31. <artifactId>commons-codec</artifactId> 32. </dependency> 33. <dependency> 34. <groupId>joda-time</groupId> 35. <artifactId>joda-time</artifactId> 36. </dependency> 37. 38. <!--jwt依赖--> 39. <dependency> 40. <groupId>io.jsonwebtoken</groupId> 41. <artifactId>jjwt</artifactId> 42. <version>0.9.1</version> 43. </dependency> 44. 45. <!--fastdfs文件存储--> 46. <dependency> 47. <groupId>com.github.tobato</groupId> 48. <artifactId>fastdfs-client</artifactId> 49. <version>1.26.7</version> 50. <exclusions> 51. <exclusion> 52. <groupId>ch.qos.logback</groupId> 53. <artifactId>logback-classic</artifactId> 54. </exclusion> 55. </exclusions> 56. </dependency> 57. 58. 59. <!-- Dubbo Spring Cloud Starter--> 60. <dependency> 61. <groupId>com.alibaba.cloud</groupId> 62. <artifactId>spring-cloud-starter-dubbo</artifactId> 63. </dependency> 64. 65. <!-- Spring Cloud Nacos Service Discovery--> 66. <dependency> 67. <groupId>com.alibaba.cloud</groupId> 68. <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> 69. </dependency> 70. 71. <!-- nacos配置中心依赖支持 72. <dependency> 73. <groupId>com.alibaba.cloud</groupId> 74. <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> 75. </dependency> 76. --> 77. <!--RabbitMQ 78. <dependency> 79. <groupId>org.springframework.boot</groupId> 80. <artifactId>spring-boot-starter-amqp</artifactId> 81. </dependency> 82. --> 83. <dependency> 84. <groupId>com.itheima</groupId> 85. <artifactId>tanhua-dubbo-interface</artifactId> 86. <version>1.0-SNAPSHOT</version> 87. </dependency> 88. <dependency> 89. <groupId>com.itheima</groupId> 90. <artifactId>tanhua-commons</artifactId> 91. <version>1.0-SNAPSHOT</version> 92. </dependency> 93. <dependency> 94. <groupId>com.itheima</groupId> 95. <artifactId>tanhua-autoconfig</artifactId> 96. <version>1.0-SNAPSHOT</version> 97. </dependency> 98. </dependencies> 99. 100. <build> 101. <finalName>tanhua-app-server</finalName> 102. <plugins> 103. <plugin> 104. <groupId>org.springframework.boot</groupId> 105. <artifactId>spring-boot-maven-plugin</artifactId> 106. <version>2.3.9.RELEASE</version> 107. </plugin> 108. </plugins> 109. </build>
tanhua-autoconfig
1. <dependencies> 2. 3. <dependency> 4. <groupId>org.springframework.boot</groupId> 5. <artifactId>spring-boot-starter-web</artifactId> 6. </dependency> 7. 8. <!--SpringDataRedis依赖--> 9. <dependency> 10. <groupId>org.springframework.boot</groupId> 11. <artifactId>spring-boot-starter-data-redis</artifactId> 12. </dependency> 13. 14. <!--lombok依赖--> 15. <dependency> 16. <groupId>org.projectlombok</groupId> 17. <artifactId>lombok</artifactId> 18. </dependency> 19. 20. <!--工具包--> 21. <dependency> 22. <groupId>org.apache.commons</groupId> 23. <artifactId>commons-lang3</artifactId> 24. </dependency> 25. <dependency> 26. <groupId>com.fasterxml.jackson.core</groupId> 27. <artifactId>jackson-databind</artifactId> 28. </dependency> 29. <dependency> 30. <groupId>commons-codec</groupId> 31. <artifactId>commons-codec</artifactId> 32. </dependency> 33. <dependency> 34. <groupId>joda-time</groupId> 35. <artifactId>joda-time</artifactId> 36. </dependency> 37. 38. <!--jwt依赖--> 39. <dependency> 40. <groupId>io.jsonwebtoken</groupId> 41. <artifactId>jjwt</artifactId> 42. <version>0.9.1</version> 43. </dependency> 44. 45. <!--fastdfs文件存储--> 46. <dependency> 47. <groupId>com.github.tobato</groupId> 48. <artifactId>fastdfs-client</artifactId> 49. <version>1.26.7</version> 50. <exclusions> 51. <exclusion> 52. <groupId>ch.qos.logback</groupId> 53. <artifactId>logback-classic</artifactId> 54. </exclusion> 55. </exclusions> 56. </dependency> 57. 58. 59. <!-- Dubbo Spring Cloud Starter--> 60. <dependency> 61. <groupId>com.alibaba.cloud</groupId> 62. <artifactId>spring-cloud-starter-dubbo</artifactId> 63. </dependency> 64. 65. <!-- Spring Cloud Nacos Service Discovery--> 66. <dependency> 67. <groupId>com.alibaba.cloud</groupId> 68. <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> 69. </dependency> 70. 71. <!-- nacos配置中心依赖支持 72. <dependency> 73. <groupId>com.alibaba.cloud</groupId> 74. <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> 75. </dependency> 76. --> 77. <!--RabbitMQ 78. <dependency> 79. <groupId>org.springframework.boot</groupId> 80. <artifactId>spring-boot-starter-amqp</artifactId> 81. </dependency> 82. --> 83. <dependency> 84. <groupId>com.itheima</groupId> 85. <artifactId>tanhua-dubbo-interface</artifactId> 86. <version>1.0-SNAPSHOT</version> 87. </dependency> 88. <dependency> 89. <groupId>com.itheima</groupId> 90. <artifactId>tanhua-commons</artifactId> 91. <version>1.0-SNAPSHOT</version> 92. </dependency> 93. <dependency> 94. <groupId>com.itheima</groupId> 95. <artifactId>tanhua-autoconfig</artifactId> 96. <version>1.0-SNAPSHOT</version> 97. </dependency> 98. </dependencies> 99. 100. <build> 101. <finalName>tanhua-app-server</finalName> 102. <plugins> 103. <plugin> 104. <groupId>org.springframework.boot</groupId> 105. <artifactId>spring-boot-maven-plugin</artifactId> 106. <version>2.3.9.RELEASE</version> 107. </plugin> 108. </plugins> 109. </build>
tanhua-commons
1. <dependencies> 2. <!--工具包--> 3. <dependency> 4. <groupId>org.apache.commons</groupId> 5. <artifactId>commons-lang3</artifactId> 6. </dependency> 7. <dependency> 8. <groupId>commons-codec</groupId> 9. <artifactId>commons-codec</artifactId> 10. </dependency> 11. <dependency> 12. <groupId>joda-time</groupId> 13. <artifactId>joda-time</artifactId> 14. </dependency> 15. <!--jwt依赖--> 16. <dependency> 17. <groupId>io.jsonwebtoken</groupId> 18. <artifactId>jjwt</artifactId> 19. <version>0.9.1</version> 20. </dependency> 21. </dependencies>
tanhua-dubbo-db
1. <dependencies> 2. 3. <dependency> 4. <groupId>org.springframework.boot</groupId> 5. <artifactId>spring-boot-starter-web</artifactId> 6. </dependency> 7. 8. <dependency> 9. <groupId>com.baomidou</groupId> 10. <artifactId>mybatis-plus</artifactId> 11. </dependency> 12. 13. <dependency> 14. <groupId>com.baomidou</groupId> 15. <artifactId>mybatis-plus-boot-starter</artifactId> 16. <version>${mybatis.mybatis-plus}</version> 17. </dependency> 18. 19. <dependency> 20. <groupId>mysql</groupId> 21. <artifactId>mysql-connector-java</artifactId> 22. </dependency> 23. 24. <dependency> 25. <groupId>com.alibaba</groupId> 26. <artifactId>druid</artifactId> 27. </dependency> 28. 29. <dependency> 30. <groupId>org.projectlombok</groupId> 31. <artifactId>lombok</artifactId> 32. </dependency> 33. 34. <dependency> 35. <groupId>org.apache.commons</groupId> 36. <artifactId>commons-lang3</artifactId> 37. </dependency> 38. 39. <dependency> 40. <groupId>com.fasterxml.jackson.core</groupId> 41. <artifactId>jackson-databind</artifactId> 42. </dependency> 43. 44. <dependency> 45. <groupId>commons-codec</groupId> 46. <artifactId>commons-codec</artifactId> 47. </dependency> 48. 49. <dependency> 50. <groupId>joda-time</groupId> 51. <artifactId>joda-time</artifactId> 52. </dependency> 53. 54. <!-- Dubbo Spring Cloud Starter --> 55. <dependency> 56. <groupId>com.alibaba.cloud</groupId> 57. <artifactId>spring-cloud-starter-dubbo</artifactId> 58. </dependency> 59. 60. <!-- Spring Cloud Nacos Service Discovery --> 61. <dependency> 62. <groupId>com.alibaba.cloud</groupId> 63. <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> 64. </dependency> 65. 66. <!-- nacos配置中心依赖支持 67. <dependency> 68. <groupId>com.alibaba.cloud</groupId> 69. <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> 70. </dependency> 71. --> 72. <dependency> 73. <groupId>com.itheima</groupId> 74. <artifactId>tanhua-dubbo-interface</artifactId> 75. <version>1.0-SNAPSHOT</version> 76. </dependency> 77. </dependencies> 78. 79. <build> 80. <finalName>tanhua-dubbo-db</finalName> 81. <plugins> 82. <plugin> 83. <groupId>org.springframework.boot</groupId> 84. <artifactId>spring-boot-maven-plugin</artifactId> 85. <version>2.3.9.RELEASE</version> 86. </plugin> 87. </plugins> 88. </build>
tanhua-dubbo-interface
1. <dependencies> 2. <dependency> 3. <groupId>com.itheima</groupId> 4. <artifactId>tanhua-model</artifactId> 5. <version>1.0-SNAPSHOT</version> 6. </dependency> 7. </dependencies>
tanhua-dubbo-mongo
1. <dependencies> 2. 3. <dependency> 4. <groupId>org.springframework.boot</groupId> 5. <artifactId>spring-boot-starter-web</artifactId> 6. </dependency> 7. 8. <dependency> 9. <groupId>org.projectlombok</groupId> 10. <artifactId>lombok</artifactId> 11. </dependency> 12. 13. <dependency> 14. <groupId>org.apache.commons</groupId> 15. <artifactId>commons-lang3</artifactId> 16. </dependency> 17. 18. <dependency> 19. <groupId>com.fasterxml.jackson.core</groupId> 20. <artifactId>jackson-databind</artifactId> 21. </dependency> 22. 23. <dependency> 24. <groupId>commons-codec</groupId> 25. <artifactId>commons-codec</artifactId> 26. </dependency> 27. 28. <dependency> 29. <groupId>joda-time</groupId> 30. <artifactId>joda-time</artifactId> 31. </dependency> 32. 33. <!-- Dubbo Spring Cloud Starter --> 34. <dependency> 35. <groupId>com.alibaba.cloud</groupId> 36. <artifactId>spring-cloud-starter-dubbo</artifactId> 37. </dependency> 38. 39. <!-- Spring Cloud Nacos Service Discovery --> 40. <dependency> 41. <groupId>com.alibaba.cloud</groupId> 42. <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> 43. </dependency> 44. 45. <!-- nacos配置中心依赖支持 46. <dependency> 47. <groupId>com.alibaba.cloud</groupId> 48. <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> 49. </dependency> 50. --> 51. <dependency> 52. <groupId>com.itheima</groupId> 53. <artifactId>tanhua-commons</artifactId> 54. <version>1.0-SNAPSHOT</version> 55. </dependency> 56. 57. <dependency> 58. <groupId>com.itheima</groupId> 59. <artifactId>tanhua-dubbo-interface</artifactId> 60. <version>1.0-SNAPSHOT</version> 61. </dependency> 62. </dependencies> 63. 64. <build> 65. <finalName>tanhua-dubbo-db</finalName> 66. <plugins> 67. <plugin> 68. <groupId>org.springframework.boot</groupId> 69. <artifactId>spring-boot-maven-plugin</artifactId> 70. <version>2.3.9.RELEASE</version> 71. </plugin> 72. </plugins> 73. </build>
tanhua-model
1. <dependencies> 2. <!--SpringDataMongo起步依赖 3. <dependency> 4. <groupId>org.springframework.boot</groupId> 5. <artifactId>spring-boot-starter-data-mongodb</artifactId> 6. </dependency> 7. <dependency> 8. <groupId>org.mongodb</groupId> 9. <artifactId>mongodb-driver-sync</artifactId> 10. <version>${mongodb.version}</version> 11. </dependency> 12. --> 13. <!--MybatisPlus起步依赖--> 14. <dependency> 15. <groupId>com.baomidou</groupId> 16. <artifactId>mybatis-plus</artifactId> 17. </dependency> 18. </dependencies>
4.6、搭建环境
tanhua-app-server端添加引导类和配置文件application.yml
1. //启动类 2. @SpringBootApplication 3. public class AppServerApplication { 4. 5. public static void main(String[] args) { 6. SpringApplication.run(AppServerApplication.class,args); 7. } 8. }