<?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>
	<url>http://maven.apache.org</url>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<spring.version>4.3.0.RELEASE</spring.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>maven.tpccn.com</nexus.server.ip>
    <nexus.release.url>http://${nexus.server.ip}/nexus/content/repositories/mbap</nexus.release.url>
	</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>
			<version>3.8.1</version>
			<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>
	</dependencies>
	<scm>
		<connection>scm:svn:svn://192.168.100.42:3693/mbap_demo/mbap.parent/mbap-util</connection>
	</scm>
	 <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>
		<plugins>
			<!-- <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> 
				</plugin> -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.7.0</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
					<encoding>UTF-8</encoding>
					<compilerArguments>
							<verbose />
							<!-- window 系统使用“;”,linux 系统使用“：”   下边的两个jar包之间的符号 -->
            				<bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
							<verbose />			
					</compilerArguments>
				</configuration>
			</plugin>
		</plugins>
	</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.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 -->
    <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>
