123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- <?xml version="1.0" encoding="UTF-8"?>
- <project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>xchat</artifactId>
- <groupId>com.xchat</groupId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>xchat-oauth2-web</artifactId>
- <packaging>war</packaging>
- <name>xchat-oauth2-web</name>
- <dependencies>
- <dependency>
- <groupId>com.xchat</groupId>
- <artifactId>xchat-oauth2-service</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>com.xchat</groupId>
- <artifactId>xchat-common</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </dependency>
- <!-- provided dependency -->
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.1</version>
- <scope>provided</scope>
- </dependency>
- <!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
- <dependency>
- <groupId>org.jsoup</groupId>
- <artifactId>jsoup</artifactId>
- <version>1.10.2</version>
- </dependency>
- <dependency>
- <groupId>com.xchat</groupId>
- <artifactId>xchat-oauth2-service</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.11</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <version>3.1.0</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <version>3.1.0</version>
- </dependency>
- </dependencies>
- <build>
- <finalName>ROOT</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <warName>ROOT</warName>
- </configuration>
- </plugin>
- <!-- jetty, set context path and spring profile -->
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-maven-plugin</artifactId>
- <configuration>
- <!--热部署时间秒-->
- <reload>automatic</reload>
- <scanIntervalSeconds>3</scanIntervalSeconds>
- <systemProperties>
- <systemProperty>
- <name>spring.profiles.active</name>
- <value>development</value>
- </systemProperty>
- </systemProperties>
- <useTestClasspath>true</useTestClasspath>
- <connectors>
- <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
- <port>8081</port>
- <maxIdleTime>60000</maxIdleTime>
- </connector>
- </connectors>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <profiles>
- <!-- 集成用的profile -->
- <profile>
- <id>integration</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <warName>ROOT</warName>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>replace-integration-settings</id>
- <phase>prepare-package</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <target>
- <echo message="--------------------------------------"/>
- <echo message="开始替换集成环境文件"/>
- <echo message="--------------------------------------"/>
- <tstamp>
- <format property="releaseVersion" pattern="yyyyMMddHHmm"/>
- </tstamp>
- <!-- 替换logback.xml文件 -->
- <delete file="${project.build.outputDirectory}/logback.xml"/>
- <copy file="src/main/resources/integration/logback.xml"
- tofile="${project.build.outputDirectory}/logback.xml"/>
- <delete file="${project.build.outputDirectory}/application-oauth2-web.properties"/>
- <copy file="src/main/resources/integration/application-oauth2-web.properties"
- tofile="${project.build.outputDirectory}/application-oauth2-web.properties"/>
- <echo message="--------------------------------------"/>
- <echo message="完成替换集成环境文件"/>
- <echo message="--------------------------------------"/>
- </target>
- </configuration>
- </execution>
- <!-- 上传war包, 并进行工程更新 -->
- <execution>
- <id>upload-integration-package</id>
- <phase>package</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <target if="upload">
- <taskdef name="scp" classname="org.apache.tools.ant.taskdefs.optional.ssh.Scp" classpathref="maven.plugin.classpath"/>
- <taskdef name="sshexec" classname="org.apache.tools.ant.taskdefs.optional.ssh.SSHExec" classpathref="maven.plugin.classpath"/>
- <echo message="--------------------------------------"/>
- <echo message="执行集成服务器上的tomcat shutdown.sh"/>
- <echo message="--------------------------------------"/>
- <sshexec host="172.19.103.87" username="javaer" password="duowan" trust="true"
- command="cd /home/javaer/whistle/whistle-oauth2-web/tomcat/bin; sh shutdown.sh"/>
- <echo message="--------------------------------------"/>
- <echo message="tomcat已停止"/>
- <echo message="将${project.build.directory}/ROOT.war上传集成服务器"/>
- <echo message="--------------------------------------"/>
- <scp file="${project.build.directory}/ROOT.war" todir="javaer:duowan@172.19.103.87:/home/javaer/whistle/whistle-oauth2-web"
- verbose="true" trust="true"/>
- <echo message="--------------------------------------"/>
- <echo message="上传完毕"/>
- <echo message="执行deploy-whistle-oauth2-web.sh 部署"/>
- <echo message="--------------------------------------"/>
- <sshexec host="172.19.103.87" username="javaer" password="duowan" trust="true"
- command="cd /home/javaer/whistle/whistle-oauth2-web; sh deploy-whistle-oauth2-web.sh"/>
- <echo message="--------------------------------------"/>
- <echo message="执行集成服务器上的tomcat startup.sh"/>
- <echo message="--------------------------------------"/>
- <sshexec host="172.19.103.87" username="javaer" password="duowan" trust="true"
- command="cd /home/javaer/whistle/whistle-oauth2-web/tomcat/bin; sh startup.sh"/>
- <echo message="--------------------------------------"/>
- <echo message="执行命令完毕"/>
- <echo message="--------------------------------------"/>
- </target>
- </configuration>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>com.jcraft</groupId>
- <artifactId>jsch</artifactId>
- <version>0.1.42</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-jsch</artifactId>
- <version>1.8.2</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </build>
- </profile>
- <!-- 潜龙用的profile -->
- <profile>
- <id>dragon</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <properties>
- <logback-console></logback-console>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <warName>ROOT</warName>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
- </project>
|