<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">
	<modelVersion>4.0.0</modelVersion>
	<groupId>bap</groupId>
	<artifactId>bap-parent</artifactId>
	<version>201606241656</version>
	<packaging>pom</packaging>

	<properties>
		<!-- 文件拷贝时的编码 -->
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<!-- 编译时的编码 -->
		<maven.compiler.encoding>UTF-8</maven.compiler.encoding>

		<spring.version>4.3.0.RELEASE</spring.version>
		<hibernate.version>4.3.11.Final</hibernate.version>
		<hibernate.common.version>5.0.1.Final</hibernate.common.version>
		<slf4j.version>1.7.21</slf4j.version>
		<jboss.loggin.version>3.3.0.Final</jboss.loggin.version>
		<aspectj.version>1.8.9</aspectj.version>
		<c3p0.version>0.9.5.2</c3p0.version>
		<freemarker.version>2.3.23</freemarker.version>
		<servlet-api.version>3.1.0</servlet-api.version>
		<timestamp>${maven.build.timestamp}</timestamp>
		<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
		<nexus.server.id>nexus-release</nexus.server.id>
		<nexus.server.ip>183.203.212.182:3691</nexus.server.ip>
		<nexus.release.url>http://${nexus.server.ip}/nexus/content/repositories/bap</nexus.release.url>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-core</artifactId>
			<version>${hibernate.version}</version>
		</dependency>
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-c3p0</artifactId>
			<version>${hibernate.version}</version>
		</dependency>
		<dependency>
			<groupId>org.hibernate.common</groupId>
			<artifactId>hibernate-commons-annotations</artifactId>
			<version>${hibernate.common.version}</version>
		</dependency>
		<dependency>
			<groupId>org.hibernate.javax.persistence</groupId>
			<artifactId>hibernate-jpa-2.1-api</artifactId>
			<version>1.0.0.Final</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-tx</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-web</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-webmvc</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-orm</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j.version}</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
			<version>${slf4j.version}</version>
		</dependency>
		<dependency>
			<groupId>org.jboss.logging</groupId>
			<artifactId>jboss-logging</artifactId>
			<version>${jboss.loggin.version}</version>
		</dependency>
		<dependency>
			<groupId>org.aspectj</groupId>
			<artifactId>aspectjrt</artifactId>
			<version>${aspectj.version}</version>
		</dependency>
		<dependency>
			<groupId>org.aspectj</groupId>
			<artifactId>aspectjweaver</artifactId>
			<version>${aspectj.version}</version>
		</dependency>
		<dependency>
			<groupId>com.mchange</groupId>
			<artifactId>c3p0</artifactId>
			<version>${c3p0.version}</version>
		</dependency>
		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
			<version>2.6</version>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>2.5</version>
		</dependency>
		<dependency>
			<groupId>commons-beanutils</groupId>
			<artifactId>commons-beanutils</artifactId>
			<version>1.9.2</version>
		</dependency>
		<dependency>
			<groupId>commons-fileupload</groupId>
			<artifactId>commons-fileupload</artifactId>
			<version>1.3.2</version>
		</dependency>
		<dependency>
			<groupId>org.freemarker</groupId>
			<artifactId>freemarker</artifactId>
			<version>${freemarker.version}</version>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<version>${servlet-api.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>jstl</artifactId>
			<version>1.2</version>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>6.0.2</version>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi</artifactId>
			<version>3.14</version>
		</dependency>
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-scratchpad</artifactId>
			<version>3.14</version>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpcore</artifactId>
			<version>4.4.4</version>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>4.5.2</version>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpmime</artifactId>
			<version>4.5.2</version>
		</dependency>
		<dependency>
			<groupId>org.json</groupId>
			<artifactId>json</artifactId>
			<version>20160212</version>
		</dependency>
	</dependencies>

	<distributionManagement>
		<repository>
			<id>${nexus.server.id}</id>
			<url>${nexus.release.url}</url>
		</repository>
	</distributionManagement>

	<repositories>
		<repository>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
			<id>nexus</id>
			<name>nexus repository</name>
			<url>http://${nexus.server.ip}/nexus/content/groups/public/</url>
		</repository>
	</repositories>
	<pluginRepositories>
		<pluginRepository>
			<releases>
				<updatePolicy>never</updatePolicy>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
			<id>nexus</id>
			<name>nexus repository</name>
			<url>http://${nexus.server.ip}/nexus/content/groups/public/</url>
		</pluginRepository>
	</pluginRepositories>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.5.1</version>
					<configuration>
						<source>1.8</source>
						<target>1.8</target>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<profiles>
		<!-- r2 parent,r2repo,r2zip都依赖 -->
		<profile>
			<activation>
				<property>
					<name>r2parent</name>
					<value>true</value>
				</property>
			</activation>
			<properties>
				<versionId>r${svn.revision}.V${timestamp}</versionId>
			</properties>
			<build>
				<plugins>
					<!-- Use the svn revision number for the built artifact -->
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>buildnumber-maven-plugin</artifactId>
						<version>1.4</version>
						<executions>
							<execution>
								<phase>validate</phase>
								<goals>
									<goal>create</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<buildNumberPropertyName>svn.revision</buildNumberPropertyName>
							<doCheck>false</doCheck>
							<doUpdate>true</doUpdate>
							<providerImplementations>
								<svn>javasvn</svn>
							</providerImplementations>
						</configuration>
						<dependencies>
							<dependency>
								<groupId>com.google.code.maven-scm-provider-svnjava</groupId>
								<artifactId>maven-scm-provider-svnjava</artifactId>
								<version>2.1.1</version>
							</dependency>
							<dependency>
								<groupId>org.tmatesoft.svnkit</groupId>
								<artifactId>svnkit</artifactId>
								<version>1.8.12</version>
							</dependency>
						</dependencies>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<version>1.8</version>
						<executions>
							<execution>
								<id>default-cli</id>
								<phase>package</phase>
								<configuration>
									<target>
										<property name="compile_classpath" refid="maven.compile.classpath" />
										<property name="project.build.sourceDirectory" value="${project.build.sourceDirectory}" />
										<property name="project.build.directory" value="${project.build.directory}" />
										<property name="project.build.outputDirectory" value="${project.build.outputDirectory}" />
										<property name="project.build.finalName" value="${project.build.finalName}" />
										<property name="project.artifactId" value="${project.artifactId}" />
										<property name="svn.revision" value="${svn.revision}" />
										<property name="timestamp" value="${timestamp}" />
										<ant antfile="${ant.build}.xml" />
									</target>
								</configuration>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<!-- release to local repositories -->
		<profile>
			<id>r2repo</id>
			<properties>
				<ant.build>build_obf</ant.build>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-install-plugin</artifactId>
						<version>2.5.2</version>
						<executions>
							<execution>
								<goals>
									<goal>install-file</goal>
								</goals>
								<phase>package</phase>
								<configuration>
									<groupId>${project.groupId}</groupId>
									<artifactId>${project.artifactId}</artifactId>
									<version>${project.version}</version>
									<packaging>jar</packaging>
									<pomFile>${project.basedir}/pom.xml</pomFile>
									<file>${project.build.directory}/${project.build.finalName}.jar</file>
									<javadoc>${project.build.directory}/${project.build.finalName}-javadoc.jar</javadoc>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<!-- release to nexus repositories -->
		<profile>
			<id>r2nexus</id>
			<properties>
				<ant.build>build_r2nexus</ant.build>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-deploy-plugin</artifactId>
						<version>2.8.2</version>
						<executions>
							<execution>
								<goals>
									<goal>deploy-file</goal>
								</goals>
								<phase>package</phase>
								<configuration>
									<repositoryId>${nexus.server.id}</repositoryId>
									<groupId>${project.groupId}</groupId>
									<artifactId>${project.artifactId}</artifactId>
									<version>${project.version}</version>
									<packaging>jar</packaging>
									<pomFile>${project.basedir}/pom.xml</pomFile>
									<file>${project.build.directory}/${project.build.finalName}.jar</file>
									<javadoc>${project.build.directory}/${project.build.finalName}-javadoc.jar</javadoc>
									<url>${nexus.release.url}</url>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<!-- release to zip -->
		<profile>
			<id>r2zip</id>
			<properties>
				<ant.build>build_r2zip</ant.build>
			</properties>
		</profile>
	</profiles>
</project>