<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.alibaba</groupId>
	<artifactId>dns-cache-manipulator</artifactId>
	<version>1.6.3</version>
	<packaging>jar</packaging>
	<name>Java Dns Cache Manipulator(DCM) Lib</name>
	<description>🌏 A simple 0-dependency thread-safe lib for setting dns programmatically without touching host file, make unit/integration test portable.</description>
	<url>https://github.com/alibaba/java-dns-cache-manipulator</url>
	<inceptionYear>2015</inceptionYear>

	<licenses>
		<license>
			<name>Apache 2</name>
			<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
			<comments>A business-friendly OSS license</comments>
		</license>
	</licenses>
	<scm>
		<connection>scm:git:git@github.com:alibaba/java-dns-cache-manipulator.git</connection>
		<developerConnection>scm:git:git@github.com:alibaba/java-dns-cache-manipulator.git</developerConnection>
		<url>git@github.com:alibaba/java-dns-cache-manipulator.git</url>
	</scm>
	<issueManagement>
		<url>https://github.com/alibaba/java-dns-cache-manipulator/issues</url>
		<system>GitHub Issues</system>
	</issueManagement>
	<organization>
		<name>Alibaba</name>
		<url>https://www.alibaba.com</url>
	</organization>
	<developers>
		<developer>
			<name>Jerry Lee</name>
			<id>oldratlee</id>
			<email>oldratlee(AT)gmail(DOT)com</email>
			<timezone>+8</timezone>
			<url>https://github.com/oldratlee</url>
			<roles>
				<role>developer</role>
			</roles>
			<organization>Alibaba</organization>
			<organizationUrl>https://www.alibaba.com</organizationUrl>
		</developer>
	</developers>

	<properties>
		<maven.compiler.source>1.6</maven.compiler.source>
		<maven.compiler.target>1.6</maven.compiler.target>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<dependencies>
		<!-- QA libs -->
		<!--
			JSR305 is already Dormant status, so SpotBugs does not release jsr305 jar file.
			Please continue using findbugs’ one.
			depend on spotbugs-annotations instead.
			https://spotbugs.readthedocs.io/en/stable/migration.html
		-->
		<dependency>
			<groupId>com.github.spotbugs</groupId>
			<artifactId>spotbugs-annotations</artifactId>
			<version>4.4.2</version>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>com.google.code.findbugs</groupId>
			<artifactId>jsr305</artifactId>
			<version>3.0.2</version>
			<optional>true</optional>
		</dependency>
		<!-- Testing libs -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.13.2</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<!--
				DO NOT upgrade commons-io version!
				v2.5 is the last version support Java 6
			-->
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<!--suppress MavenPackageUpdate -->
			<version>2.5</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
	</distributionManagement>

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.2.0</version>
				<configuration>
					<archive>
						<manifestEntries>
							<Agent-Class>com.alibaba.dcm.agent.DcmAgent</Agent-Class>
							<Can-Redefine-Classes>false</Can-Redefine-Classes>
							<Can-Retransform-Classes>false</Can-Retransform-Classes>
							<Can-Set-Native-Method-Prefix>false</Can-Set-Native-Method-Prefix>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.sonatype.plugins</groupId>
				<artifactId>nexus-staging-maven-plugin</artifactId>
				<version>1.6.8</version>
				<extensions>true</extensions>
				<configuration>
					<serverId>ossrh</serverId>
					<nexusUrl>https://oss.sonatype.org/</nexusUrl>
					<autoReleaseAfterClose>true</autoReleaseAfterClose>
				</configuration>
			</plugin>
			<!--
				official docs: https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html

				add maven-enforce-plugin to make sure the right jdk is used
				https://stackoverflow.com/a/18420462/922688
			-->
			<plugin>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>3.0.0</version>
				<executions>
					<execution>
						<id>enforce-maven</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<requireMavenVersion>
									<version>3.3.9</version>
								</requireMavenVersion>
								<requireJavaVersion>
									<version>[1.8,)</version>
								</requireJavaVersion>
							</rules>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<!--
					config example: https://github.com/mojohaus/versions-maven-plugin/issues/157#issuecomment-306041074
				-->
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>versions-maven-plugin</artifactId>
				<version>2.8.1</version>
				<configuration>
					<rulesUri>file://${maven.multiModuleProjectDirectory}/library/src/versions-rules.xml</rulesUri>
					<generateBackupPoms>false</generateBackupPoms>
				</configuration>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<artifactId>maven-clean-plugin</artifactId>
					<version>3.1.0</version>
				</plugin>
				<plugin>
					<artifactId>maven-resources-plugin</artifactId>
					<version>3.2.0</version>
				</plugin>
				<plugin>
					<artifactId>maven-source-plugin</artifactId>
					<version>3.2.1</version>
				</plugin>
				<plugin>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.8.1</version>
				</plugin>
				<plugin>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>3.3.1</version>
				</plugin>
				<plugin>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.22.2</version>
				</plugin>
				<plugin>
					<artifactId>maven-site-plugin</artifactId>
					<version>3.9.1</version>
				</plugin>
				<plugin>
					<artifactId>maven-install-plugin</artifactId>
					<version>2.5.2</version>
				</plugin>
				<plugin>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>2.8.2</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	<profiles>
		<profile>
			<id>gen-src</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-source-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>gen-javadoc</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-javadoc-plugin</artifactId>
						<configuration>
							<source>8</source>
							<show>protected</show>
							<charset>UTF-8</charset>
							<encoding>UTF-8</encoding>
							<docencoding>UTF-8</docencoding>
							<!-- https://maven.apache.org/plugins/maven-javadoc-plugin/examples/exclude-package-names.html -->
							<excludePackageNames>*.internal:*.internal.*</excludePackageNames>
							<overview>src/api/overview.html</overview>
							<doclint>none</doclint>
							<additionalJOptions>
								<!--
									Maven javadoc Search redirects to "/undefined/.." url - Stack Overflow
									https://stackoverflow.com/questions/52326318
								-->
								<additionalJOption>--no-module-directories</additionalJOption>

								<additionalJOption>-html5</additionalJOption>
								<additionalJOption>-quiet</additionalJOption>
								<additionalJOption>-J-Duser.language=en -J-Duser.country=US</additionalJOption>
							</additionalJOptions>
						</configuration>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>gen-sign</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>3.0.1</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>gen-git-properties</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<!--
						Maven plugin which includes build-time git repository information into an POJO / *.properties).
						Make your apps tell you which version exactly they were built from! Priceless in large distributed deployments.
							https://github.com/git-commit-id/git-commit-id-maven-plugin
					-->
					<plugin>
						<groupId>io.github.git-commit-id</groupId>
						<artifactId>git-commit-id-maven-plugin</artifactId>
						<version>5.0.0</version>
						<executions>
							<execution>
								<id>get-the-git-infos</id>
								<goals>
									<goal>revision</goal>
								</goals>
							</execution>
							<execution>
								<id>validate-the-git-infos</id>
								<goals>
									<goal>validateRevision</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<validationProperties>
								<!-- verify that the current repository is not dirty -->
								<validationProperty>
									<name>validating git dirty</name>
									<value>${git.dirty}</value>
									<shouldMatchTo>false</shouldMatchTo>
								</validationProperty>
							</validationProperties>
							<generateGitPropertiesFile>true</generateGitPropertiesFile>
							<generateGitPropertiesFilename>${project.build.outputDirectory}/META-INF/scm/${project.groupId}/${project.artifactId}/git.properties</generateGitPropertiesFilename>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>lint</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<!--
						https://spotbugs.github.io/
						https://spotbugs.readthedocs.io/en/latest/introduction.html
						https://spotbugs.readthedocs.io/en/latest/maven.html

						Spotbugs support @SuppressWarnings
						https://github.com/spotbugs/spotbugs/issues/737#issuecomment-416118033
					-->
					<plugin>
						<groupId>com.github.spotbugs</groupId>
						<artifactId>spotbugs-maven-plugin</artifactId>
						<version>4.4.2.2</version>
						<executions>
							<execution>
								<phase>test-compile</phase>
								<goals>
									<goal>check</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>gen-code-cov</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.eluder.coveralls</groupId>
						<artifactId>coveralls-maven-plugin</artifactId>
						<version>4.3.0</version>
						<configuration>
							<repoToken>${env.COVERALLS_REPO_TOKEN}</repoToken>
						</configuration>
						<!-- https://github.com/trautonen/coveralls-maven-plugin/issues/112 -->
						<dependencies>
							<dependency>
								<groupId>javax.xml.bind</groupId>
								<artifactId>jaxb-api</artifactId>
								<version>2.2.3</version>
							</dependency>
						</dependencies>
					</plugin>
					<plugin>
						<!-- for codecov.io -->
						<!-- config example: https://github.com/codecov/example-java -->
						<!-- plugin docs: http://eclemma.org/jacoco/trunk/doc/ -->
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
						<version>0.8.7</version>
						<executions>
							<execution>
								<goals>
									<goal>prepare-agent</goal>
								</goals>
								<!--
									https://www.eclemma.org/jacoco/trunk/doc/prepare-agent-mojo.html
								-->
								<configuration>
									<append>true</append>
								</configuration>
							</execution>
							<execution>
								<id>report</id>
								<phase>test</phase>
								<goals>
									<goal>report</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<!--
								Maven Jacoco Configuration - Exclude classes/packages from report not working - Stack Overflow
								https://stackoverflow.com/questions/27799419
							-->
							<excludes>
								<exclude>com/alibaba/dcm/internal/JavaVersion.class</exclude>
								<exclude>com/alibaba/dcm/internal/IPAddressUtil.class</exclude>
							</excludes>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>enforcer-when-do-release</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<!--
						add maven-enforce-plugin to make sure the right jdk is used
						https://stackoverflow.com/a/18420462/922688
					-->
					<plugin>
						<artifactId>maven-enforcer-plugin</artifactId>
						<executions>
							<execution>
								<id>enforce-jdk-versions</id>
								<goals>
									<goal>enforce</goal>
								</goals>
								<configuration>
									<rules>
										<requireJavaVersion>
											<version>11</version>
										</requireJavaVersion>
									</rules>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
