当前位置:   article > 正文

IDEA创建多模块项目常用pom_idea创建pom工程

idea创建pom工程

 一、父模块pom文件

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5. <modelVersion>4.0.0</modelVersion>
  6. <groupId>com.xxxx.xxxx</groupId>
  7. <artifactId>xxxx-parent</artifactId>
  8. <version>1.0</version>
  9. <packaging>pom</packaging>
  10. <name>xxxx-parent</name>
  11. <description>xxxx</description>
  12. <properties>
  13. <!-- 项目版本 -->
  14. <revision>1.0</revision>
  15. <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
  16. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  17. <fastjson.version>1.2.76</fastjson.version>
  18. <lombok.version>1.18.20</lombok.version>
  19. <spring-boot-dependencies.version>2.4.5</spring-boot-dependencies.version>
  20. <tio.version>3.7.2.v20210316-RELEASE</tio.version>
  21. <protostuff.version>1.7.4</protostuff.version>
  22. <postgresql.version>42.2.20</postgresql.version>
  23. <pagehelper-spring-boot-starter.version>1.3.0</pagehelper-spring-boot-starter.version>
  24. <pinyin4j.version>2.5.1</pinyin4j.version>
  25. <hibernate-validator.version>7.0.1.Final</hibernate-validator.version>
  26. <springfox-boot-starter.version>3.0.0</springfox-boot-starter.version>
  27. <hutool.version>5.7.2</hutool.version>
  28. <kaptcha.version>2.3.2</kaptcha.version>
  29. <mybatis-spring-boot-starter.version>2.2.0</mybatis-spring-boot-starter.version>
  30. <rocketmq-spring-boot-starter.version>2.2.0</rocketmq-spring-boot-starter.version>
  31. <rocketmq-client.version>4.9.0</rocketmq-client.version>
  32. <querydsl.version>4.4.0</querydsl.version>
  33. <druid-spring-boot-starter.version>1.2.6</druid-spring-boot-starter.version>
  34. <mybatis.generator.core>1.3.2</mybatis.generator.core>
  35. <mybatis.generator.maven.plugin>1.3.2</mybatis.generator.maven.plugin>
  36. <ip2region.version>1.7.2</ip2region.version>
  37. <common.lange3>3.12.0</common.lange3>
  38. <redisson.version>3.16.8</redisson.version>
  39. <springfox.version>2.9.2</springfox.version>
  40. <swagger.models.version>1.5.22</swagger.models.version>
  41. <jim.version>3.0.0.v20200501-RELEASE</jim.version>
  42. <easyexcel.version>3.0.5</easyexcel.version>
  43. <log4j2.version>2.17.0</log4j2.version>
  44. </properties>
  45. <dependencies>
  46. <dependency>
  47. <groupId>com.alibaba</groupId>
  48. <artifactId>fastjson</artifactId>
  49. <version>${fastjson.version}</version>
  50. </dependency>
  51. <dependency>
  52. <groupId>org.projectlombok</groupId>
  53. <artifactId>lombok</artifactId>
  54. <optional>true</optional>
  55. </dependency>
  56. <!-- 工具类(包含日志 、POI文档操作、缓存、数据库、表达式、日志、基础工具类、验证码、socket等等) -->
  57. <!-- API文档参考:https://apidoc.gitee.com/dromara/hutool/ -->
  58. <dependency>
  59. <groupId>cn.hutool</groupId>
  60. <artifactId>hutool-all</artifactId>
  61. <version>${hutool.version}</version>
  62. </dependency>
  63. </dependencies>
  64. <dependencyManagement>
  65. <dependencies>
  66. <!-- 验证码 -->
  67. <dependency>
  68. <groupId>com.github.penggle</groupId>
  69. <artifactId>kaptcha</artifactId>
  70. <version>${kaptcha.version}</version>
  71. </dependency>
  72. <dependency>
  73. <groupId>com.alibaba</groupId>
  74. <artifactId>easyexcel</artifactId>
  75. <version>${easyexcel.version}</version>
  76. </dependency>
  77. <!--分页插件-->
  78. <dependency>
  79. <groupId>com.github.pagehelper</groupId>
  80. <artifactId>pagehelper-spring-boot-starter</artifactId>
  81. <version>${pagehelper-spring-boot-starter.version}</version>
  82. </dependency>
  83. <dependency>
  84. <groupId>org.apache.commons</groupId>
  85. <artifactId>commons-lang3</artifactId>
  86. <version>${common.lange3}</version>
  87. </dependency>
  88. <!-- spring boot 家族 -->
  89. <dependency>
  90. <groupId>org.springframework.boot</groupId>
  91. <artifactId>spring-boot-dependencies</artifactId>
  92. <version>${spring-boot-dependencies.version}</version>
  93. <type>pom</type>
  94. <scope>import</scope>
  95. </dependency>
  96. <!-- 数据库 -->
  97. <dependency>
  98. <groupId>org.postgresql</groupId>
  99. <artifactId>postgresql</artifactId>
  100. <version>${postgresql.version}</version>
  101. </dependency>
  102. <!-- springfox -->
  103. <dependency>
  104. <groupId>io.springfox</groupId>
  105. <artifactId>springfox-swagger-ui</artifactId>
  106. <version>${springfox.version}</version>
  107. </dependency>
  108. <dependency>
  109. <groupId>io.springfox</groupId>
  110. <artifactId>springfox-swagger2</artifactId>
  111. <version>${springfox.version}</version>
  112. </dependency>
  113. <dependency>
  114. <groupId>io.swagger</groupId>
  115. <artifactId>swagger-models</artifactId>
  116. <!--1.5.22-->
  117. <version>${swagger.models.version}</version>
  118. </dependency>
  119. <!-- alibaba-druid -->
  120. <dependency>
  121. <groupId>com.alibaba</groupId>
  122. <artifactId>druid-spring-boot-starter</artifactId>
  123. <version>${druid-spring-boot-starter.version}</version>
  124. </dependency>
  125. <!-- 拼音工具类 -->
  126. <dependency>
  127. <groupId>com.belerweb</groupId>
  128. <artifactId>pinyin4j</artifactId>
  129. <version>${pinyin4j.version}</version>
  130. </dependency>
  131. <!-- 验证框架 -->
  132. <dependency>
  133. <groupId>org.hibernate</groupId>
  134. <artifactId>hibernate-validator</artifactId>
  135. <version>${hibernate-validator.version}</version>
  136. </dependency>
  137. <!-- mybatis框架 -->
  138. <dependency>
  139. <groupId>org.mybatis.spring.boot</groupId>
  140. <artifactId>mybatis-spring-boot-starter</artifactId>
  141. <version>${mybatis-spring-boot-starter.version}</version>
  142. </dependency>
  143. <!-- Rocketmq -->
  144. <dependency>
  145. <groupId>org.apache.rocketmq</groupId>
  146. <artifactId>rocketmq-spring-boot-starter</artifactId>
  147. <version>${rocketmq-spring-boot-starter.version}</version>
  148. </dependency>
  149. <dependency>
  150. <groupId>org.apache.rocketmq</groupId>
  151. <artifactId>rocketmq-client</artifactId>
  152. <version>${rocketmq-client.version}</version>
  153. </dependency>
  154. <!-- tio系列 -->
  155. <dependency>
  156. <groupId>org.t-io</groupId>
  157. <artifactId>tio-core</artifactId>
  158. <version>${tio.version}</version>
  159. </dependency>
  160. <dependency>
  161. <groupId>org.t-io</groupId>
  162. <artifactId>tio-websocket-server</artifactId>
  163. <version>${tio.version}</version>
  164. </dependency>
  165. <!--ip转地址-->
  166. <dependency>
  167. <groupId>org.lionsoul</groupId>
  168. <artifactId>ip2region</artifactId>
  169. <version>${ip2region.version}</version>
  170. </dependency>
  171. <!-- 分布式锁 适配 https://github.com/redisson/redisson/tree/master/redisson-spring-boot-starter -->
  172. <!-- 示例: https://blog.csdn.net/vistaed/article/details/107026758 -->
  173. <dependency>
  174. <groupId>org.redisson</groupId>
  175. <artifactId>redisson-spring-boot-starter</artifactId>
  176. <version>${redisson.version}</version>
  177. </dependency>
  178. </dependencies>
  179. </dependencyManagement>
  180. <modules>
  181. <module>xxxx</module>
  182. <module>chat-server</module>
  183. <module>im</module>
  184. <module>xxxx_mq</module>
  185. </modules>
  186. </project>

二、子模块pom

包含springboot启动

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5. <parent>
  6. <groupId>com.xxxx.xxxx</groupId>
  7. <artifactId>xxxx-parent</artifactId>
  8. <version>1.0</version>
  9. </parent>
  10. <modelVersion>4.0.0</modelVersion>
  11. <artifactId>chat-server</artifactId>
  12. <properties>
  13. <j-im.version>3.0.0.v20200501-RELEASE</j-im.version>
  14. <jedis.version>2.9.3</jedis.version>
  15. </properties>
  16. <dependencies>
  17. <dependency>
  18. <groupId>org.springframework.boot</groupId>
  19. <artifactId>spring-boot-starter-web</artifactId>
  20. <!-- 移除掉默认支持的 Tomcat -->
  21. <exclusions>
  22. <exclusion>
  23. <groupId>org.springframework.boot</groupId>
  24. <artifactId>spring-boot-starter-tomcat</artifactId>
  25. </exclusion>
  26. </exclusions>
  27. </dependency>
  28. <!-- 添加 Undertow 容器 -->
  29. <dependency>
  30. <groupId>org.springframework.boot</groupId>
  31. <artifactId>spring-boot-starter-undertow</artifactId>
  32. </dependency>
  33. <dependency>
  34. <groupId>org.springframework.boot</groupId>
  35. <artifactId>spring-boot-starter-data-redis</artifactId>
  36. </dependency>
  37. <!-- <dependency>
  38. <groupId>org.j-im</groupId>
  39. <artifactId>jim-server</artifactId>
  40. <version>${j-im.version}</version>
  41. </dependency> -->
  42. <!--引入mq-->
  43. <dependency>
  44. <groupId>com.xxxx.xxxx</groupId>
  45. <artifactId>xxxx_mq</artifactId>
  46. <version>${project.version}</version>
  47. </dependency>
  48. <dependency>
  49. <groupId>com.xxxx.xxxx</groupId>
  50. <artifactId>im-server</artifactId>
  51. <version>${project.version}</version>
  52. </dependency>
  53. <dependency>
  54. <groupId>redis.clients</groupId>
  55. <artifactId>jedis</artifactId>
  56. <version>${jedis.version}</version>
  57. </dependency>
  58. </dependencies>
  59. <build>
  60. <plugins>
  61. <plugin>
  62. <groupId>org.springframework.boot</groupId>
  63. <artifactId>spring-boot-maven-plugin</artifactId>
  64. <executions>
  65. <execution>
  66. <goals>
  67. <goal>repackage</goal>
  68. </goals>
  69. </execution>
  70. </executions>
  71. </plugin>
  72. <plugin>
  73. <groupId>org.apache.maven.plugins</groupId>
  74. <artifactId>maven-compiler-plugin</artifactId>
  75. <configuration>
  76. <source>8</source>
  77. <target>8</target>
  78. </configuration>
  79. </plugin>
  80. </plugins>
  81. </build>
  82. </project>

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/524178
推荐阅读
相关标签