<?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">
	<modelVersion>4.0.0</modelVersion>
	
	<groupId>com.whosly</groupId>
	<artifactId>base-core</artifactId>
	<version>1.5.0-RELEASE</version>
	<packaging>pom</packaging>
	<name>${project.artifactId}</name>
	<url>https://github.com/yueny/base</url>
	<description>base dependency</description>

	<properties>
		<file.encoding>UTF-8</file.encoding>
		<project.build.sourceEncoding>${file.encoding}</project.build.sourceEncoding>
		<java.version>1.7</java.version>
		<skip.maven.deploy>false</skip.maven.deploy>
		<skipTest>true</skipTest>
		
		<!-- maven插件版本号 -->
		<maven.compiler.plugin.version>3.6.1</maven.compiler.plugin.version>
		<maven.deploy.plugin.version>2.8.2</maven.deploy.plugin.version>
		<maven.surefire.plugin.version>2.20</maven.surefire.plugin.version>
		<maven.jar.plugin.version>3.0.2</maven.jar.plugin.version>
		<maven.eclipse.plugin.version>2.10</maven.eclipse.plugin.version>
		<maven.codehaus.mojo.version>2.2</maven.codehaus.mojo.version>
		<maven.codehaus.sonar.version>4.5.7</maven.codehaus.sonar.version>
		<maven.assembly.plugin.version>3.0.0</maven.assembly.plugin.version>
		<maven.release.plugin.version>2.5.3</maven.release.plugin.version>
		<maven.lombok.plugin.version>1.16.6.1</maven.lombok.plugin.version>
		<maven.resources.plugin.version>2.5</maven.resources.plugin.version>
		<maven.scm.plugin.version>1.9.5</maven.scm.plugin.version>

		<!-- 需要 ${env} -->
		<maven.war.plugin.version>2.2</maven.war.plugin.version>

		<nexus.maven.url.version>https://nexus.codealy.com</nexus.maven.url.version>

		<!-- Sonar -->
		<jacoco.maven.version>0.7.9</jacoco.maven.version>
		<jetty.maven.plugin.version>9.2.9.v20150224</jetty.maven.plugin.version>
		
		<!-- 可重写覆盖项 -->
		<sonar.java.binaries>${basedir}/target/classes/com</sonar.java.binaries>
		<jetty.port>8212</jetty.port>
    	<jetty.logger.level>DEBUG</jetty.logger.level>
    	
		<version-maven-javadoc-plugin>2.10.4</version-maven-javadoc-plugin>
		<version-maven-source-plugin>2.2.1</version-maven-source-plugin>

		<sonatypeOssDistMgmtSnapshotsUrl>https://oss.sonatype.org/content/repositories/snapshots/</sonatypeOssDistMgmtSnapshotsUrl>
		<arguments />

	</properties>

	<build>
		<pluginManagement>
			<plugins>
				<!--  必须配置GPG插件用于使用以下配置对组件进行签名 -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>1.6</version>
					<executions>
						<execution>
							<id>sign-artifacts</id>
							<phase>verify</phase>
							<goals>
								<goal>sign</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<!-- 编译源代码 -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>${maven.compiler.plugin.version}</version>
					<configuration>
						<skip>${skipTest}</skip>
						<source>${java.version}</source>
						<target>${java.version}</target>
						<encoding>${file.encoding}</encoding>
						<compilerVersion>${java.version}</compilerVersion>
					</configuration>
				</plugin>
				<!-- 发布插件  -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>${maven.deploy.plugin.version}</version>
					<configuration>
						<skip>${skip.maven.deploy}</skip>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-eclipse-plugin</artifactId>
					<version>${maven.eclipse.plugin.version}</version>
					<configuration>
						<downloadSources>true</downloadSources>
						<downloadJavadocs>false</downloadJavadocs>
						<ajdtVersion>none</ajdtVersion>
					</configuration>
				</plugin>
				<plugin>
	                 <groupId>org.apache.maven.plugins</groupId>
	                 <artifactId>maven-release-plugin</artifactId>
	                 <version>${maven.release.plugin.version}</version>
	                 <configuration>
					   <mavenExecutorId>forked-path</mavenExecutorId>
	                   <useReleaseProfile>false</useReleaseProfile>
					   <arguments>${arguments} -Psonatype-oss-release</arguments>
	                 </configuration>
	            </plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>2.7</version>
					<executions>
						<execution>
							<id>attach-javadocs</id>
							<goals>
								<goal>jar</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>2.1.2</version>
					<executions>
						<execution>
							<id>attach-sources</id>
							<goals>
								<goal>jar-no-fork</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
	                <groupId>org.codehaus.mojo</groupId>
	                <artifactId>versions-maven-plugin</artifactId>
	                <version>${maven.codehaus.mojo.version}</version>
	            </plugin>
	            
	            <plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>${maven.surefire.plugin.version}</version>
					<configuration>
						<useSystemClassLoader>true</useSystemClassLoader>
						<forkMode>once</forkMode>
						<skip>${skipTest}</skip>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-assembly-plugin</artifactId>
					<version>${maven.assembly.plugin.version}</version>
					<configuration>
						<descriptorRefs>
							<descriptorRef>jar-with-dependencies</descriptorRef>
						</descriptorRefs>
					</configuration>
				</plugin>
				<plugin>
				    <groupId>org.projectlombok</groupId>
				    <artifactId>lombok-maven-plugin</artifactId>
				    <version>${maven.lombok.plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>${maven.resources.plugin.version}</version>
					<configuration>
						<encoding>UTF-8</encoding>
					</configuration>
				</plugin>
				
				<plugin>
					<groupId>org.codehaus.sonar</groupId>
					<artifactId>sonar-maven-plugin</artifactId>
					<version>${maven.codehaus.sonar.version}</version>
					<executions>
						<execution>
							<id>sonar</id>
							<phase>site</phase>
							<goals>
								<goal>sonar</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.eclipse.jetty</groupId>
					<artifactId>jetty-maven-plugin</artifactId>
					<version>${jetty.maven.plugin.version}</version>
					<configuration>
						<httpConnector>
							<port>${jetty.port}</port>
						</httpConnector>
						<scanIntervalSeconds>0</scanIntervalSeconds>
						<systemProperties>
							<systemProperty>
								<name>org.eclipse.jetty.LEVEL</name>
								<value>${jetty.logger.level}</value>
							</systemProperty>
						</systemProperties>
					</configuration>
				</plugin>

				<!-- maven-scm 支持 -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-scm-plugin</artifactId>
					<version>${maven.scm.plugin.version}</version>
					<configuration>
						<connectionType>developerConnection</connectionType>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<profiles>
		<!-- 默认本地 -->
		<profile>
			<id>nexus</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-compiler-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
					</plugin>
				</plugins>
			</build>

			<!--	&lt;!&ndash; 个人下载仓库 repositories &ndash;&gt;-->
			<!--
			repositories id,
					与 distributionManagement ID，
					与 setting.xml 中 mirrors id、 server id 均保持一致
			-->
			<repositories>
				<repository>
					<id>nexus-snapshots</id>
					<url>${nexus.maven.url.version}/repository/maven-public/</url>
					<snapshots>
						<updatePolicy>always</updatePolicy>
					</snapshots>
				</repository>
			</repositories>

			<!-- 个人发布仓库  distributionManagement  -->
			<distributionManagement>
				<snapshotRepository>
					<id>nexus-snapshots</id>
					<name>Snapshots Repository</name>
					<url>${nexus.maven.url.version}/repository/snapshots/</url>
				</snapshotRepository>
				<repository>
					<id>nexus-releases</id>
					<name>nexus repository</name>
					<url>${nexus.maven.url.version}/repository/releases-yueny/</url>
				</repository>
			</distributionManagement>
		</profile>

		<!--
			由于生成javadoc和源jar以及使用GPG签署组件是一个相当耗时的过程，因此这些执行通常与正常的构建配置隔离并移动到配置文件中。
			然后，在通过激活配置文件执行部署时，将使用此配置文件。
		-->
		<profile>
			<id>sonatype-oss-nexus</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-compiler-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-release-plugin</artifactId>
					</plugin>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-enforcer-plugin</artifactId>
						<version>1.2</version>
						<executions>
							<execution>
								<id>enforce-maven</id>
								<goals>
									<goal>enforce</goal>
								</goals>
								<configuration>
									<rules>
										<requireMavenVersion>
											<version>(,2.1.0),(2.1.0,2.2.0),(2.2.0,)</version>
											<message>Maven 2.1.0 and 2.2.0 produce incorrect GPG signatures and checksums respectively.</message>
										</requireMavenVersion>
									</rules>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>


			<!-- 【注】snapshotRepository 与 repository 中的 id 一定要与 setting.xml 中 server 的 id 保持一致！ -->
			<!--   &lt;!&ndash; 个人下载仓库 repositories &ndash;&gt;  -->
			<repositories>
				<repository>
					<id>sonatype-nexus-snapshots</id>
					<name>Sonatype Nexus Snapshots</name>
					<url>https://oss.sonatype.org/content/repositories/snapshots</url>
					<releases>
						<enabled>false</enabled>
					</releases>
					<snapshots>
						<enabled>true</enabled>
					</snapshots>
				</repository>
			</repositories>

			<!-- sonatype 发布仓库 -->
			<distributionManagement>
				<snapshotRepository>
					<id>sonatype-nexus-snapshots</id>
					<name>Sonatype Nexus Snapshots</name>
					<url>${sonatypeOssDistMgmtSnapshotsUrl}</url>
				</snapshotRepository>
				<repository>
					<id>sonatype-nexus-staging</id>
					<name>Nexus Release Repository</name>
					<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
				</repository>
			</distributionManagement>
		</profile>
	</profiles>

	<licenses>
		<!-- Apache许可证 -->
		<license>
			<name>The Apache Software License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<!-- SCM信息 -->
	<scm>
		<url>https://gitee.com/whosly/base</url>
		<connection>scm:https://gitee.com/whosly/base.git</connection>
		<developerConnection>scm:https://gitee.com/whosly/base.git</developerConnection>
		<tag>HEAD</tag>
	</scm>

	<!-- 开发者信息 -->
	<developers>
		<developer>
			<name>fengyang</name>
			<email>deep_blue_yang@126.com</email>
			<url>https://github.com/yueny</url>
			<roles>
				<role>software engineer</role>
			</roles>
			<timezone>9</timezone>
		</developer>
	</developers>
	
</project>