pom.xml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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. <artifactId>cpp</artifactId>
  7. <groupId>com.jiayue.cpp</groupId>
  8. <version>3.8.8</version>
  9. </parent>
  10. <modelVersion>4.0.0</modelVersion>
  11. <packaging>jar</packaging>
  12. <artifactId>cpp-admin</artifactId>
  13. <description>
  14. web服务入口
  15. </description>
  16. <dependencies>
  17. <!-- spring-boot-devtools -->
  18. <dependency>
  19. <groupId>org.springframework.boot</groupId>
  20. <artifactId>spring-boot-devtools</artifactId>
  21. <optional>true</optional> <!-- 表示依赖不会传递 -->
  22. </dependency>
  23. <!-- swagger3-->
  24. <dependency>
  25. <groupId>io.springfox</groupId>
  26. <artifactId>springfox-boot-starter</artifactId>
  27. </dependency>
  28. <!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
  29. <dependency>
  30. <groupId>io.swagger</groupId>
  31. <artifactId>swagger-models</artifactId>
  32. <version>1.6.2</version>
  33. </dependency>
  34. <!-- Mysql驱动包 -->
  35. <dependency>
  36. <groupId>mysql</groupId>
  37. <artifactId>mysql-connector-java</artifactId>
  38. </dependency>
  39. <!-- 核心模块-->
  40. <dependency>
  41. <groupId>com.jiayue.cpp</groupId>
  42. <artifactId>cpp-framework</artifactId>
  43. </dependency>
  44. <!-- 定时任务-->
  45. <dependency>
  46. <groupId>com.jiayue.cpp</groupId>
  47. <artifactId>cpp-quartz</artifactId>
  48. </dependency>
  49. <!-- 代码生成-->
  50. <dependency>
  51. <groupId>com.jiayue.cpp</groupId>
  52. <artifactId>cpp-generator</artifactId>
  53. </dependency>
  54. <dependency>
  55. <groupId>org.springframework.boot</groupId>
  56. <artifactId>spring-boot-starter-thymeleaf</artifactId>
  57. </dependency>
  58. </dependencies>
  59. <profiles> <!--考虑到window 和linux环境 npm命令格式的问题,使用maven的profile实现动态指定命令-->
  60. <profile>
  61. <id>window</id>
  62. <properties>
  63. <npm>npm.cmd</npm>
  64. </properties>
  65. <activation>
  66. <activeByDefault>true</activeByDefault>
  67. </activation>
  68. </profile>
  69. <profile>
  70. <id>linux</id>
  71. <properties>
  72. <npm>npm</npm>
  73. </properties>
  74. </profile>
  75. </profiles>
  76. <build>
  77. <finalName>cpp</finalName>
  78. <plugins>
  79. <!--跳过test类-->
  80. <plugin>
  81. <groupId>org.apache.maven.plugins</groupId>
  82. <artifactId>maven-surefire-plugin</artifactId>
  83. <version>2.21.0</version>
  84. <configuration>
  85. <skipTests>true</skipTests>
  86. </configuration>
  87. </plugin>
  88. <plugin>
  89. <groupId>org.codehaus.mojo</groupId>
  90. <artifactId>exec-maven-plugin</artifactId>
  91. <version>1.6.0</version>
  92. <executions>
  93. <execution>
  94. <id>exec-npm-run-build</id>
  95. <phase>generate-resources</phase>
  96. <goals>
  97. <goal>exec</goal>
  98. </goals>
  99. <configuration>
  100. <executable>${npm}</executable>
  101. <arguments>
  102. <argument>run</argument>
  103. <argument>build:prod</argument>
  104. </arguments>
  105. <workingDirectory>${project.parent.basedir}/cpp-ui</workingDirectory>
  106. </configuration>
  107. </execution>
  108. </executions>
  109. </plugin>
  110. <!--资源插件,主要为了从前端项目里复制打包好的文件到springboot项目-->
  111. <plugin>
  112. <groupId>org.apache.maven.plugins</groupId>
  113. <artifactId>maven-resources-plugin</artifactId>
  114. <version>3.1.0</version>
  115. <executions>
  116. <execution>
  117. <id>copy index</id>
  118. <phase>generate-resources</phase>
  119. <goals>
  120. <goal>copy-resources</goal>
  121. </goals>
  122. <configuration>
  123. <!-- 复制前端打包文件到这里 -->
  124. <outputDirectory>src/main/resources/templates</outputDirectory>
  125. <overwrite>true</overwrite>
  126. <resources>
  127. <resource>
  128. <!-- 从前端打包的目录dist进行指定文件、文件夹内容的复制-->
  129. <directory>${project.parent.basedir}/cpp-ui/dist</directory>
  130. <includes>
  131. <!-- 具体根据实际前端代码、及目录结构进行配置-->
  132. <include>index.html</include>
  133. </includes>
  134. </resource>
  135. </resources>
  136. </configuration>
  137. </execution>
  138. <execution>
  139. <id>copy static</id>
  140. <phase>generate-resources</phase>
  141. <goals>
  142. <goal>copy-resources</goal>
  143. </goals>
  144. <configuration>
  145. <!-- 复制前端打包文件到这里 -->
  146. <outputDirectory>src/main/resources</outputDirectory>
  147. <overwrite>true</overwrite>
  148. <resources>
  149. <resource>
  150. <!-- 从前端打包的目录dist进行指定文件、文件夹内容的复制-->
  151. <directory>${project.parent.basedir}/cpp-ui/dist</directory>
  152. <includes>
  153. <!-- 具体根据实际前端代码、及目录结构进行配置-->
  154. <include>static/</include>
  155. </includes>
  156. </resource>
  157. </resources>
  158. </configuration>
  159. </execution>
  160. </executions>
  161. </plugin>
  162. <plugin>
  163. <groupId>org.springframework.boot</groupId>
  164. <artifactId>spring-boot-maven-plugin</artifactId>
  165. <version>2.1.7.RELEASE</version>
  166. <configuration>
  167. <!--控制是否启用支持Linux下service方式运行-->
  168. <executable>true</executable>
  169. <!--打包后自动运行程序-->
  170. <!-- <includeSystemScope>true</includeSystemScope>-->
  171. </configuration>
  172. <executions>
  173. <execution>
  174. <goals>
  175. <goal>build-info</goal>
  176. <goal>repackage</goal>
  177. </goals>
  178. </execution>
  179. </executions>
  180. </plugin>
  181. </plugins>
  182. </build>
  183. </project>