<?xml version="1.0"?>
<project
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
	xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>mbap</groupId>
		<artifactId>mbap.parent</artifactId>
		<version>0.0.1-SNAPSHOT</version>
	</parent>
	<artifactId>mbap-util</artifactId>
	<name>mbap-util</name>
	<version>${versionId}</version>
	<properties>
		<spring.version>4.3.0.RELEASE</spring.version>
	</properties>
	<dependencies>
		<!-- 代码优化工具 -->
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
		</dependency>
		<dependency>
			<groupId>org.kie.modules</groupId>
			<artifactId>org-apache-commons-lang3</artifactId>
			<type>pom</type>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
		<dependency>
			<groupId>org.jsoup</groupId>
			<artifactId>jsoup</artifactId>
			<version>1.8.3</version>
		</dependency>
		<dependency>
			<groupId>org.json</groupId>
			<artifactId>json</artifactId>
			<version>20160212</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>net.sf.json-lib</groupId>
			<artifactId>json-lib</artifactId>
			<version>2.4</version>
			<classifier>jdk15</classifier>
		</dependency>
		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>fastjson</artifactId>
			<version>1.2.6</version>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<version>3.1.0</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-web</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.yaml</groupId>
			<artifactId>snakeyaml</artifactId>
		</dependency>
		<dependency>
	      <groupId>org.freemarker</groupId>
	      <artifactId>freemarker</artifactId>
	      <version>2.3.23</version>
	     <!--  <scope>compile</scope> -->
	    </dependency>
	</dependencies>
	<scm>
		<connection>scm:svn:svn://192.168.100.42:3693/mbap_demo/mbap.parent/mbap-util</connection>
	</scm>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
		</plugins>
	</build>
	
	<!-- 私服仓库配置 -->
	<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>
	<!-- 工具服务打包命令配置 -->
	<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.2</version>
								<exclusions>
									<exclusion>
										<groupId>org.tmatesoft.svnkit</groupId>
										<artifactId>svnkit</artifactId>
									</exclusion>
								</exclusions>
							</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 打包并提交到nexus私服仓库-->
		<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>
