pom.xml 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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. <dependency>
  59. <groupId>org.projectlombok</groupId>
  60. <artifactId>lombok</artifactId>
  61. </dependency>
  62. <!-- ftp-->
  63. <dependency>
  64. <groupId>commons-net</groupId>
  65. <artifactId>commons-net</artifactId>
  66. <version>3.3</version>
  67. </dependency>
  68. <dependency>
  69. <groupId>cn.hutool</groupId>
  70. <artifactId>hutool-all</artifactId>
  71. <version>5.8.12</version>
  72. </dependency>
  73. <!-- SSH安全连接所使用的类库 -->
  74. <dependency>
  75. <groupId>com.jcraft</groupId>
  76. <artifactId>jsch</artifactId>
  77. <version>0.1.55</version>
  78. <scope>compile</scope>
  79. <optional>true</optional>
  80. </dependency>
  81. </dependencies>
  82. <profiles> <!--考虑到window 和linux环境 npm命令格式的问题,使用maven的profile实现动态指定命令-->
  83. <profile>
  84. <id>window</id>
  85. <properties>
  86. <npm>npm.cmd</npm>
  87. </properties>
  88. <activation>
  89. <activeByDefault>true</activeByDefault>
  90. </activation>
  91. </profile>
  92. <profile>
  93. <id>linux</id>
  94. <properties>
  95. <npm>npm</npm>
  96. </properties>
  97. </profile>
  98. </profiles>
  99. <build>
  100. <finalName>cpp</finalName>
  101. <plugins>
  102. <!--跳过test类-->
  103. <plugin>
  104. <groupId>org.apache.maven.plugins</groupId>
  105. <artifactId>maven-surefire-plugin</artifactId>
  106. <version>2.21.0</version>
  107. <configuration>
  108. <skipTests>true</skipTests>
  109. </configuration>
  110. </plugin>
  111. <plugin>
  112. <groupId>org.codehaus.mojo</groupId>
  113. <artifactId>exec-maven-plugin</artifactId>
  114. <version>1.6.0</version>
  115. <executions>
  116. <execution>
  117. <id>exec-npm-run-build</id>
  118. <phase>generate-resources</phase>
  119. <goals>
  120. <goal>exec</goal>
  121. </goals>
  122. <configuration>
  123. <executable>${npm}</executable>
  124. <arguments>
  125. <argument>run</argument>
  126. <argument>build:prod</argument>
  127. </arguments>
  128. <workingDirectory>${project.parent.basedir}/cpp-ui</workingDirectory>
  129. </configuration>
  130. </execution>
  131. </executions>
  132. </plugin>
  133. <!--资源插件,主要为了从前端项目里复制打包好的文件到springboot项目-->
  134. <plugin>
  135. <groupId>org.apache.maven.plugins</groupId>
  136. <artifactId>maven-resources-plugin</artifactId>
  137. <version>3.1.0</version>
  138. <executions>
  139. <execution>
  140. <id>copy index</id>
  141. <phase>generate-resources</phase>
  142. <goals>
  143. <goal>copy-resources</goal>
  144. </goals>
  145. <configuration>
  146. <!-- 复制前端打包文件到这里 -->
  147. <outputDirectory>src/main/resources/templates</outputDirectory>
  148. <overwrite>true</overwrite>
  149. <resources>
  150. <resource>
  151. <!-- 从前端打包的目录dist进行指定文件、文件夹内容的复制-->
  152. <directory>${project.parent.basedir}/cpp-ui/dist</directory>
  153. <includes>
  154. <!-- 具体根据实际前端代码、及目录结构进行配置-->
  155. <include>index.html</include>
  156. </includes>
  157. </resource>
  158. </resources>
  159. </configuration>
  160. </execution>
  161. <execution>
  162. <id>copy static</id>
  163. <phase>generate-resources</phase>
  164. <goals>
  165. <goal>copy-resources</goal>
  166. </goals>
  167. <configuration>
  168. <!-- 复制前端打包文件到这里 -->
  169. <outputDirectory>src/main/resources</outputDirectory>
  170. <overwrite>true</overwrite>
  171. <resources>
  172. <resource>
  173. <!-- 从前端打包的目录dist进行指定文件、文件夹内容的复制-->
  174. <directory>${project.parent.basedir}/cpp-ui/dist</directory>
  175. <includes>
  176. <!-- 具体根据实际前端代码、及目录结构进行配置-->
  177. <include>static/</include>
  178. </includes>
  179. </resource>
  180. </resources>
  181. </configuration>
  182. </execution>
  183. </executions>
  184. </plugin>
  185. <plugin>
  186. <groupId>org.springframework.boot</groupId>
  187. <artifactId>spring-boot-maven-plugin</artifactId>
  188. <version>2.1.7.RELEASE</version>
  189. <configuration>
  190. <!--控制是否启用支持Linux下service方式运行-->
  191. <executable>true</executable>
  192. <!--打包后自动运行程序-->
  193. <!-- <includeSystemScope>true</includeSystemScope>-->
  194. </configuration>
  195. <executions>
  196. <execution>
  197. <goals>
  198. <goal>build-info</goal>
  199. <goal>repackage</goal>
  200. </goals>
  201. </execution>
  202. </executions>
  203. </plugin>
  204. </plugins>
  205. </build>
  206. </project>