pom.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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>xchat</artifactId>
  7. <groupId>com.xchat</groupId>
  8. <version>0.0.1-SNAPSHOT</version>
  9. </parent>
  10. <modelVersion>4.0.0</modelVersion>
  11. <artifactId>xchat-oauth2-web</artifactId>
  12. <packaging>war</packaging>
  13. <name>xchat-oauth2-web</name>
  14. <dependencies>
  15. <dependency>
  16. <groupId>com.xchat</groupId>
  17. <artifactId>xchat-oauth2-service</artifactId>
  18. <version>0.0.1-SNAPSHOT</version>
  19. </dependency>
  20. <dependency>
  21. <groupId>com.xchat</groupId>
  22. <artifactId>xchat-common</artifactId>
  23. <version>0.0.1-SNAPSHOT</version>
  24. </dependency>
  25. <!-- provided dependency -->
  26. <dependency>
  27. <groupId>javax.servlet</groupId>
  28. <artifactId>servlet-api</artifactId>
  29. <version>2.4</version>
  30. <scope>provided</scope>
  31. </dependency>
  32. <dependency>
  33. <groupId>javax.servlet.jsp</groupId>
  34. <artifactId>jsp-api</artifactId>
  35. <version>2.1</version>
  36. <scope>provided</scope>
  37. </dependency>
  38. <!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
  39. <dependency>
  40. <groupId>org.jsoup</groupId>
  41. <artifactId>jsoup</artifactId>
  42. <version>1.10.2</version>
  43. </dependency>
  44. <dependency>
  45. <groupId>com.xchat</groupId>
  46. <artifactId>xchat-oauth2-service</artifactId>
  47. <version>0.0.1-SNAPSHOT</version>
  48. </dependency>
  49. <dependency>
  50. <groupId>junit</groupId>
  51. <artifactId>junit</artifactId>
  52. <version>4.11</version>
  53. </dependency>
  54. <dependency>
  55. <groupId>javax.servlet</groupId>
  56. <artifactId>javax.servlet-api</artifactId>
  57. <version>3.1.0</version>
  58. </dependency>
  59. <dependency>
  60. <groupId>javax.servlet</groupId>
  61. <artifactId>javax.servlet-api</artifactId>
  62. <version>3.1.0</version>
  63. </dependency>
  64. </dependencies>
  65. <build>
  66. <finalName>ROOT</finalName>
  67. <plugins>
  68. <plugin>
  69. <groupId>org.apache.maven.plugins</groupId>
  70. <artifactId>maven-war-plugin</artifactId>
  71. <configuration>
  72. <warName>ROOT</warName>
  73. </configuration>
  74. </plugin>
  75. <!-- jetty, set context path and spring profile -->
  76. <plugin>
  77. <groupId>org.mortbay.jetty</groupId>
  78. <artifactId>jetty-maven-plugin</artifactId>
  79. <configuration>
  80. <!--热部署时间秒-->
  81. <reload>automatic</reload>
  82. <scanIntervalSeconds>3</scanIntervalSeconds>
  83. <systemProperties>
  84. <systemProperty>
  85. <name>spring.profiles.active</name>
  86. <value>development</value>
  87. </systemProperty>
  88. </systemProperties>
  89. <useTestClasspath>true</useTestClasspath>
  90. <connectors>
  91. <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
  92. <port>8081</port>
  93. <maxIdleTime>60000</maxIdleTime>
  94. </connector>
  95. </connectors>
  96. </configuration>
  97. </plugin>
  98. </plugins>
  99. </build>
  100. <profiles>
  101. <!-- 生产用的profile -->
  102. <profile>
  103. <id>test</id>
  104. <build>
  105. <plugins>
  106. <plugin>
  107. <groupId>org.apache.maven.plugins</groupId>
  108. <artifactId>maven-war-plugin</artifactId>
  109. <configuration>
  110. <warName>ROOT</warName>
  111. </configuration>
  112. </plugin>
  113. <plugin>
  114. <groupId>org.apache.maven.plugins</groupId>
  115. <artifactId>maven-antrun-plugin</artifactId>
  116. <executions>
  117. <execution>
  118. <id>replace-test-settings</id>
  119. <phase>prepare-package</phase>
  120. <goals>
  121. <goal>run</goal>
  122. </goals>
  123. <configuration>
  124. <target>
  125. <echo message="--------------------------------------"/>
  126. <echo message="开始替换测试环境文件"/>
  127. <echo message="--------------------------------------"/>
  128. <tstamp>
  129. <format property="releaseVersion" pattern="yyyyMMddHHmm"/>
  130. </tstamp>
  131. <!-- 替换logback.xml文件 -->
  132. <delete file="${project.build.outputDirectory}/logback.xml"/>
  133. <copy file="src/main/resources/test/logback.xml"
  134. tofile="${project.build.outputDirectory}/logback.xml"/>
  135. <delete file="${project.build.outputDirectory}/application-oauth2-web.properties"/>
  136. <copy file="src/main/resources/test/application-oauth2-web.properties"
  137. tofile="${project.build.outputDirectory}/application-oauth2-web.properties"/>
  138. <echo message="--------------------------------------"/>
  139. <echo message="完成替换测试环境文件"/>
  140. <echo message="--------------------------------------"/>
  141. </target>
  142. </configuration>
  143. </execution>
  144. </executions>
  145. <dependencies>
  146. <dependency>
  147. <groupId>com.jcraft</groupId>
  148. <artifactId>jsch</artifactId>
  149. <version>0.1.50</version>
  150. </dependency>
  151. <dependency>
  152. <groupId>org.apache.ant</groupId>
  153. <artifactId>ant-jsch</artifactId>
  154. <version>1.8.2</version>
  155. </dependency>
  156. </dependencies>
  157. </plugin>
  158. </plugins>
  159. </build>
  160. </profile>
  161. <!-- 生产用的profile -->
  162. <profile>
  163. <id>prod</id>
  164. <build>
  165. <plugins>
  166. <plugin>
  167. <groupId>org.apache.maven.plugins</groupId>
  168. <artifactId>maven-war-plugin</artifactId>
  169. <configuration>
  170. <warName>ROOT</warName>
  171. </configuration>
  172. </plugin>
  173. <plugin>
  174. <groupId>org.apache.maven.plugins</groupId>
  175. <artifactId>maven-antrun-plugin</artifactId>
  176. <executions>
  177. <execution>
  178. <id>replace-prod-settings</id>
  179. <phase>prepare-package</phase>
  180. <goals>
  181. <goal>run</goal>
  182. </goals>
  183. <configuration>
  184. <target>
  185. <echo message="--------------------------------------"/>
  186. <echo message="开始替换生产环境文件"/>
  187. <echo message="--------------------------------------"/>
  188. <tstamp>
  189. <format property="releaseVersion" pattern="yyyyMMddHHmm"/>
  190. </tstamp>
  191. <!-- 替换logback.xml文件 -->
  192. <delete file="${project.build.outputDirectory}/logback.xml"/>
  193. <copy file="src/main/resources/prod/logback.xml"
  194. tofile="${project.build.outputDirectory}/logback.xml"/>
  195. <delete file="${project.build.outputDirectory}/application-oauth2-web.properties"/>
  196. <copy file="src/main/resources/prod/application-oauth2-web.properties"
  197. tofile="${project.build.outputDirectory}/application-oauth2-web.properties"/>
  198. <echo message="--------------------------------------"/>
  199. <echo message="完成替换生产环境文件"/>
  200. <echo message="--------------------------------------"/>
  201. </target>
  202. </configuration>
  203. </execution>
  204. </executions>
  205. <dependencies>
  206. <dependency>
  207. <groupId>com.jcraft</groupId>
  208. <artifactId>jsch</artifactId>
  209. <version>0.1.50</version>
  210. </dependency>
  211. <dependency>
  212. <groupId>org.apache.ant</groupId>
  213. <artifactId>ant-jsch</artifactId>
  214. <version>1.8.2</version>
  215. </dependency>
  216. </dependencies>
  217. </plugin>
  218. </plugins>
  219. </build>
  220. </profile>
  221. </profiles>
  222. </project>