pom.xml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  5. <modelVersion>4.0.0</modelVersion>
  6. <parent>
  7. <groupId>com.shanghaichengdi</groupId>
  8. <artifactId>download-center</artifactId>
  9. <version>1.0-SNAPSHOT</version>
  10. </parent>
  11. <groupId>com.shanghaichengdi</groupId>
  12. <artifactId>download-center-server</artifactId>
  13. <version>0.0.1-SNAPSHOT</version>
  14. <name>downloadPictures</name>
  15. <description>download-center-server</description>
  16. <properties>
  17. <java.version>1.8</java.version>
  18. <fastjson.version>1.2.83</fastjson.version>
  19. </properties>
  20. <dependencies>
  21. <dependency>
  22. <groupId>org.springframework.boot</groupId>
  23. <artifactId>spring-boot-starter</artifactId>
  24. </dependency>
  25. <dependency>
  26. <groupId>org.springframework.boot</groupId>
  27. <artifactId>spring-boot-starter-web</artifactId>
  28. </dependency>
  29. <dependency>
  30. <groupId>org.springframework.boot</groupId>
  31. <artifactId>spring-boot-starter-test</artifactId>
  32. <scope>test</scope>
  33. </dependency>
  34. <dependency>
  35. <groupId>org.projectlombok</groupId>
  36. <artifactId>lombok</artifactId>
  37. </dependency>
  38. <dependency>
  39. <groupId>com.shanghaichengdi</groupId>
  40. <artifactId>download-center-common</artifactId>
  41. <version>1.0-SNAPSHOT</version>
  42. <scope>compile</scope>
  43. </dependency>
  44. <dependency>
  45. <groupId>com.alibaba</groupId>
  46. <artifactId>fastjson</artifactId>
  47. <version>${fastjson.version}</version>
  48. </dependency>
  49. </dependencies>
  50. <profiles>
  51. <profile>
  52. <!-- 本地开发环境 -->
  53. <id>dev</id>
  54. <properties>
  55. <profiles.active>dev</profiles.active>
  56. </properties>
  57. </profile>
  58. <profile>
  59. <!-- 发布环境 -->
  60. <id>pro-file</id>
  61. <properties>
  62. <profiles.active>pro/fileServer</profiles.active>
  63. </properties>
  64. </profile>
  65. <profile>
  66. <!-- 发布环境 -->
  67. <id>pro-service</id>
  68. <properties>
  69. <profiles.active>pro/serviceServer</profiles.active>
  70. </properties>
  71. <activation>
  72. <!-- 设置默认激活这个配置 -->
  73. <activeByDefault>true</activeByDefault>
  74. </activation>
  75. </profile>
  76. <profile>
  77. <!-- 测试环境 -->
  78. <id>test</id>
  79. <properties>
  80. <profiles.active>test</profiles.active>
  81. </properties>
  82. </profile>
  83. </profiles>
  84. <build>
  85. <finalName>downloadPictures</finalName>
  86. <plugins>
  87. <plugin>
  88. <artifactId>maven-war-plugin</artifactId>
  89. <version>3.0.0</version>
  90. </plugin>
  91. <plugin>
  92. <groupId>org.springframework.boot</groupId>
  93. <artifactId>spring-boot-maven-plugin</artifactId>
  94. <version>2.0.3.RELEASE</version>
  95. <configuration>
  96. <mainClass>
  97. com.shanghaichengdi.downloadcenterserver.DownloadCenterServerApplication
  98. </mainClass>
  99. <includeSystemScope>true</includeSystemScope>
  100. </configuration>
  101. <executions>
  102. <execution>
  103. <goals>
  104. <goal>repackage</goal>
  105. </goals>
  106. </execution>
  107. </executions>
  108. </plugin>
  109. <plugin>
  110. <groupId>org.apache.maven.plugins</groupId>
  111. <artifactId>maven-dependency-plugin</artifactId>
  112. <version>2.10</version>
  113. <executions>
  114. <execution>
  115. <id>copy-dependencies</id>
  116. <phase>compile</phase>
  117. <goals>
  118. <goal>copy-dependencies</goal>
  119. </goals>
  120. <configuration>
  121. <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/lib
  122. </outputDirectory>
  123. <includeScope>system</includeScope>
  124. </configuration>
  125. </execution>
  126. </executions>
  127. </plugin>
  128. <plugin>
  129. <groupId>org.jetbrains.kotlin</groupId>
  130. <artifactId>kotlin-maven-plugin</artifactId>
  131. <version>${kotlin.version}</version>
  132. <executions>
  133. <execution>
  134. <id>compile</id>
  135. <phase>compile</phase>
  136. <goals>
  137. <goal>compile</goal>
  138. </goals>
  139. </execution>
  140. <execution>
  141. <id>test-compile</id>
  142. <phase>test-compile</phase>
  143. <goals>
  144. <goal>test-compile</goal>
  145. </goals>
  146. </execution>
  147. </executions>
  148. <configuration>
  149. <jvmTarget>1.8</jvmTarget>
  150. </configuration>
  151. </plugin>
  152. <plugin>
  153. <groupId>org.apache.maven.plugins</groupId>
  154. <artifactId>maven-compiler-plugin</artifactId>
  155. <version>3.8.1</version>
  156. <executions>
  157. <execution>
  158. <id>compile</id>
  159. <phase>compile</phase>
  160. <goals>
  161. <goal>compile</goal>
  162. </goals>
  163. </execution>
  164. <execution>
  165. <id>testCompile</id>
  166. <phase>test-compile</phase>
  167. <goals>
  168. <goal>testCompile</goal>
  169. </goals>
  170. </execution>
  171. </executions>
  172. <configuration>
  173. <source>1.8</source>
  174. <target>1.8</target>
  175. <encoding>UTF-8</encoding>
  176. </configuration>
  177. </plugin>
  178. </plugins>
  179. <resources>
  180. <resource>
  181. <directory>src/main/java</directory>
  182. <!-- 此配置不可缺,否则mybatis的Mapper.xml将会丢失 -->
  183. <includes>
  184. <include>**/*.xml</include>
  185. </includes>
  186. </resource>
  187. <resource>
  188. <!--打包时先排除不必要的文件,想要指定加入的再下面的resource指定-->
  189. <directory>${project.basedir}/src/main/resources</directory>
  190. <excludes>
  191. <exclude>profile/**</exclude>
  192. </excludes>
  193. </resource>
  194. <resource>
  195. <!-- 根据不同的环境,把对应文件夹里的配置文件打包-->
  196. <directory>${project.basedir}/src/main/resources/profile/${profiles.active}</directory>
  197. <filtering>true</filtering>
  198. </resource>
  199. </resources>
  200. </build>
  201. </project>