<?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>

	<parent>
		<groupId>io.earcam.maven</groupId>
		<artifactId>io.earcam.maven.pom</artifactId>
		<version>2.1.2</version>
	</parent>

	<groupId>io.earcam.wrapped</groupId>
	<artifactId>com.sun.tools.attach</artifactId>
	<version>1.8.0_jdk8u162-b12</version>
	<packaging>jar</packaging>

	<description>Maven repackaging of OpenJDK's com.sun.tools.attach and com.sun.tools.attach.spi packages</description>
	<url>https://bitbucket.org/earcam/com.sun.tools.attach</url>
	<inceptionYear>2017</inceptionYear>
	<licenses>
		<license>
			<name>GNU Lesser General Public License v2 + Classpath Exception</name>
			<url>http://openjdk.java.net/legal/gplv2+ce.html</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<scm>
		<connection>scm:git:git://bitbucket.org/${coordinate.username.project}.git</connection>
		<developerConnection>scm:git:ssh://bitbucket.org:${coordinate.username.project}.git</developerConnection>
		<url>https://bitbucket.org/${coordinate.username.project}</url>
		<tag>HEAD</tag>
	</scm>
	<issueManagement>
		<system>BitBucket</system>
		<url>https://bitbucket.org/${coordinate.username.project}/issues</url>
	</issueManagement>
	<ciManagement>
		<system>Jenkins</system>
		<url>https://travis-ci.org/${coordinate.username.project}</url>
	</ciManagement>
	<distributionManagement>
		<site>
			<id>BitBucket</id>
			<name>No site to deploy</name>
			<url>https://bitbucket.org/${coordinate.username.project}</url>
		</site>
	</distributionManagement>

	<properties>
		<openjdk.scm.tag>jdk8u162-b12</openjdk.scm.tag>

		<version.java.platform>8</version.java.platform>
		<version.java>1.${version.java.platform}</version.java>
		<maven.compiler.source>${version.java}</maven.compiler.source>
		<maven.compiler.target>${version.java}</maven.compiler.target>

		<coordinate.username.project>earcam/${project.artifactId}</coordinate.username.project>
		<openjdk.scm.url>http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/</openjdk.scm.url>
		<dir.source>${project.build.directory}/faux-source</dir.source>
		
		
		<revapi.skip>true</revapi.skip>
		<forbiddenapis.skip>true</forbiddenapis.skip>
	</properties>

	<dependencies>
		<dependency>
			<groupId>com.google.code.findbugs</groupId>
			<artifactId>jsr305</artifactId>
			<version>3.0.2</version>
			<scope>provided</scope>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
			<exclusions>
				<exclusion>
					<groupId>org.hamcrest</groupId>
					<artifactId>hamcrest-core</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>java-hamcrest</artifactId>
			<version>2.0.0.0</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-toolchains-plugin</artifactId>
					<version>1.1</version>
					<executions>
						<execution>
							<goals>
								<goal>toolchain</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<toolchains>
							<jdk>
								<version>[${version.java},)</version>
								<vendor>oracle</vendor>
							</jdk>
						</toolchains>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<inherited>true</inherited>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.apache.maven.plugins</groupId>
										<artifactId>maven-scm-plugin</artifactId>
										<versionRange>[1.9.5,)</versionRange>
										<goals>
											<goal>checkout</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>

								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.apache.maven.plugins</groupId>
										<artifactId>maven-antrun-plugin</artifactId>
										<versionRange>[1.8,)</versionRange>
										<goals>
											<goal>run</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-scm-plugin</artifactId>
				<version>1.9.5</version>
				<configuration>
					<connectionUrl>scm:hg:${openjdk.scm.url}</connectionUrl>
					<scmVersion>${openjdk.scm.tag}</scmVersion>
					<scmVersionType>tag</scmVersionType>
					<skipCheckoutIfExists>true</skipCheckoutIfExists>
				</configuration>
				<executions>
					<execution>
						<id>clone</id>
						<goals>
							<goal>checkout</goal>
						</goals>
						<phase>generate-sources</phase>
					</execution>
				</executions>
				<dependencies>
					<dependency>
						<groupId>org.apache.maven.scm</groupId>
						<artifactId>maven-scm-provider-hg</artifactId>
						<version>1.9.5</version>
					</dependency>
				</dependencies>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.8</version>
				<executions>
					<execution>
						<id>copy-sources</id>
						<phase>process-resources</phase>
						<configuration>
							<target>
								<copy todir="${dir.source}/com/sun/tools/attach/">
									<fileset
										dir="${project.build.directory}/checkout/src/share/classes/com/sun/tools/attach/"
										includes="**" />
								</copy>

								<copy todir="${dir.source}/sun/tools/attach/">
									<fileset
										dir="${project.build.directory}/checkout/src/share/classes/sun/tools/attach/"
										includes="**" />
								</copy>

								<copy todir="${dir.source}/sun/tools/attach/">
									<fileset
										dir="${project.build.directory}/checkout/src/solaris/classes/sun/tools/attach/"
										includes="**" />
								</copy>

								<copy todir="${dir.source}/sun/tools/attach/">
									<fileset
										dir="${project.build.directory}/checkout/src/windows/classes/sun/tools/attach"
										includes="**" />
								</copy>

								<copy todir="${dir.source}/sun/jvmstat/">
									<fileset
										dir="${project.build.directory}/checkout/src/share/classes/sun/jvmstat/"
										includes="**" />
								</copy>

								<delete
									file="${dir.source}/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider" />
							</target>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>3.0.0</version>
				<executions>
					<execution>
						<id>add-source</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>${dir.source}</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.7.0</version>
				<configuration>
					<source>${maven.compiler.source}</source>
					<target>${maven.compiler.target}</target>
					<encoding>${project.build.sourceEncoding}</encoding>
					<showDeprecation>true</showDeprecation>
					<showWarnings>true</showWarnings>
					<compilerArgument>-Xlint:all</compilerArgument>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<testFailureIgnore>false</testFailureIgnore>
					<includes>
						<include>**/*Test.java</include>
					</includes>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>test</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<version>3.5.0</version>
				<extensions>true</extensions>
				<configuration>
					<archive>
						<addMavenDescriptor>true</addMavenDescriptor>
					</archive>
					<supportedProjectTypes>
						<supportedProjectType>jar</supportedProjectType>
					</supportedProjectTypes>
					<instructions>
						<Export-Package>${project.artifactId}.*,${project.groupId}.${project.artifactId}.*</Export-Package>
						<Bundle-Description>${project.description}</Bundle-Description>
						<Bundle-DocURL>http://openjdk.java.net/projects/jdk8/</Bundle-DocURL>
						<Bundle-License>GPLv2+CE</Bundle-License>
						<Specification-Vendor>OpenJDK</Specification-Vendor>
						<Specification-Title>${project.artifactId}</Specification-Title>
						<Specification-Version>${version.spec.dio}</Specification-Version>
						<Scm-Url>${openjdk.scm.url}</Scm-Url>
						<Project-Url>${project.url}</Project-Url>
					</instructions>
				</configuration>
				<executions>
					<execution>
						<id>create-manifest</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>manifest</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.0.2</version>
				<configuration>
					<archive>
						<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
					</archive>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>jar</goal>
						</goals>
						<configuration>
							<sourcepath>${dir.source}</sourcepath>
							<failOnError>false</failOnError>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
