pom.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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>integration</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-integration-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/integration/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/integration/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. <!-- 上传war包, 并进行工程更新 -->
  145. <execution>
  146. <id>upload-integration-package</id>
  147. <phase>package</phase>
  148. <goals>
  149. <goal>run</goal>
  150. </goals>
  151. <configuration>
  152. <target if="upload">
  153. <taskdef name="scp" classname="org.apache.tools.ant.taskdefs.optional.ssh.Scp" classpathref="maven.plugin.classpath"/>
  154. <taskdef name="sshexec" classname="org.apache.tools.ant.taskdefs.optional.ssh.SSHExec" classpathref="maven.plugin.classpath"/>
  155. <echo message="--------------------------------------"/>
  156. <echo message="执行集成服务器上的tomcat shutdown.sh"/>
  157. <echo message="--------------------------------------"/>
  158. <sshexec host="172.19.103.87" username="javaer" password="duowan" trust="true"
  159. command="cd /home/javaer/whistle/whistle-oauth2-web/tomcat/bin; sh shutdown.sh"/>
  160. <echo message="--------------------------------------"/>
  161. <echo message="tomcat已停止"/>
  162. <echo message="将${project.build.directory}/ROOT.war上传集成服务器"/>
  163. <echo message="--------------------------------------"/>
  164. <scp file="${project.build.directory}/ROOT.war" todir="javaer:duowan@172.19.103.87:/home/javaer/whistle/whistle-oauth2-web"
  165. verbose="true" trust="true"/>
  166. <echo message="--------------------------------------"/>
  167. <echo message="上传完毕"/>
  168. <echo message="执行deploy-whistle-oauth2-web.sh 部署"/>
  169. <echo message="--------------------------------------"/>
  170. <sshexec host="172.19.103.87" username="javaer" password="duowan" trust="true"
  171. command="cd /home/javaer/whistle/whistle-oauth2-web; sh deploy-whistle-oauth2-web.sh"/>
  172. <echo message="--------------------------------------"/>
  173. <echo message="执行集成服务器上的tomcat startup.sh"/>
  174. <echo message="--------------------------------------"/>
  175. <sshexec host="172.19.103.87" username="javaer" password="duowan" trust="true"
  176. command="cd /home/javaer/whistle/whistle-oauth2-web/tomcat/bin; sh startup.sh"/>
  177. <echo message="--------------------------------------"/>
  178. <echo message="执行命令完毕"/>
  179. <echo message="--------------------------------------"/>
  180. </target>
  181. </configuration>
  182. </execution>
  183. </executions>
  184. <dependencies>
  185. <dependency>
  186. <groupId>com.jcraft</groupId>
  187. <artifactId>jsch</artifactId>
  188. <version>0.1.42</version>
  189. </dependency>
  190. <dependency>
  191. <groupId>org.apache.ant</groupId>
  192. <artifactId>ant-jsch</artifactId>
  193. <version>1.8.2</version>
  194. </dependency>
  195. </dependencies>
  196. </plugin>
  197. </plugins>
  198. </build>
  199. </profile>
  200. <!-- 潜龙用的profile -->
  201. <profile>
  202. <id>dragon</id>
  203. <activation>
  204. <activeByDefault>true</activeByDefault>
  205. </activation>
  206. <properties>
  207. <logback-console></logback-console>
  208. </properties>
  209. <build>
  210. <plugins>
  211. <plugin>
  212. <groupId>org.apache.maven.plugins</groupId>
  213. <artifactId>maven-war-plugin</artifactId>
  214. <configuration>
  215. <warName>ROOT</warName>
  216. </configuration>
  217. </plugin>
  218. </plugins>
  219. </build>
  220. </profile>
  221. </profiles>
  222. </project>