<?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.2.2</version>
	</parent>

	<groupId>io.earcam</groupId>
	<artifactId>io.earcam.instrumental</artifactId>
	<version>0.1.0</version>
	<packaging>pom</packaging>

	<description>Utility tooling for instrumentation, test scaffolding, etc</description>
	<url>https://instrumental.earcam.io</url>
	<inceptionYear>2018</inceptionYear>

	<modules>
		<module>io.earcam.instrumental.reflect</module>
		<module>io.earcam.instrumental.compile</module>
		<module>io.earcam.instrumental.compile.glue</module>

		<module>io.earcam.instrumental.lade</module>
		<module>io.earcam.instrumental.lade.jpms</module>

		<module>io.earcam.instrumental.fluent</module>
		<module>io.earcam.instrumental.fluency</module>

		<module>io.earcam.instrumental.module.manifest</module>
		<module>io.earcam.instrumental.module.auto</module>
		<module>io.earcam.instrumental.module.jpms</module>
		<module>io.earcam.instrumental.module.osgi</module>

		<module>io.earcam.instrumental.archive</module>
		<module>io.earcam.instrumental.archive.jpms</module>
		<module>io.earcam.instrumental.archive.osgi</module>
		<module>io.earcam.instrumental.archive.sign</module>
		<module>io.earcam.instrumental.archive.glue</module>
		<module>io.earcam.instrumental.archive.maven</module>

		<module>io.earcam.instrumental.proxy</module>
		<module>io.earcam.instrumental.proxy.concrete</module>

		<module>io.earcam.instrumental.agent</module>
		<module>io.earcam.instrumental.agent.junit</module>
		<module>io.earcam.instrumental.agent.defy</module>

		<!-- <module>io.earcam.instrumental.uber</module> -->
	</modules>

	<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}/tree/master</url>
		<tag>v0.1.0</tag>
	</scm>
	<issueManagement>
		<system>BitBucket</system>
		<url>https://bitbucket.org/${coordinate.username.project}/issues</url>
	</issueManagement>
	<ciManagement>
		<system>Travis</system>
		<url>https://travis-ci.org/${coordinate.username.project}</url>
	</ciManagement>
	<distributionManagement>
		<site>
			<id>netlify</id>
			<url>${site.url}${earcam.project.name.short}</url>
		</site>
	</distributionManagement>

	<properties>
		<version.earcam.utilitarian>1.2.0</version.earcam.utilitarian>
		<version.earcam.unexceptional>1.0.0</version.earcam.unexceptional>
		<version.earcam.maven.plugin>0.0.3-SNAPSHOT</version.earcam.maven.plugin>

		<version.cglib>3.2.7</version.cglib>
		<version.objenesis>2.6</version.objenesis>
		<version.asm>6.2</version.asm>
		<version.antlr>4.7.1</version.antlr>
		<version.bouncy.castle>1.60</version.bouncy.castle>
		<version.slf4j>1.7.25</version.slf4j>
		<version.junit4>4.12</version.junit4>
		<version.junit5>5.3.0-M1</version.junit5>
		<version.junit.platform>1.3.0-M1</version.junit.platform>

		<version.sun.tools.attach>1.8.0_jdk8u172-b11</version.sun.tools.attach>

		<site.url>https://instrumental.earcam.io/</site.url>
		<earcam.project.name.short />
		
		<earcam.project.root.artifactId>io.earcam.instrumental</earcam.project.root.artifactId>
		<coordinate.username.project>earcam/${earcam.project.root.artifactId}</coordinate.username.project>

		<skip.execution.pitest>true</skip.execution.pitest>
		<!-- failing on root pom -->
		<tidy.skip>true</tidy.skip>
		<revapi.skip>true</revapi.skip><!-- not committing to semver til v1.0.0 -->

		<java.home.9>/usr/lib/jvm/java-9-oracle</java.home.9>
		<java.home.10>/usr/lib/jvm/java-10-oracle</java.home.10>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>io.earcam</groupId>
				<artifactId>io.earcam.unexceptional</artifactId>
				<version>${version.earcam.unexceptional}</version>
			</dependency>

			<dependency>
				<groupId>io.earcam.utilitarian</groupId>
				<artifactId>io.earcam.utilitarian.io</artifactId>
				<version>${version.earcam.utilitarian}</version>
			</dependency>

			<dependency>
				<groupId>io.earcam.utilitarian</groupId>
				<artifactId>io.earcam.utilitarian.io.file</artifactId>
				<version>${version.earcam.utilitarian}</version>
			</dependency>

			<dependency>
				<groupId>io.earcam.utilitarian</groupId>
				<artifactId>io.earcam.utilitarian.charstar</artifactId>
				<version>${version.earcam.utilitarian}</version>
			</dependency>

			<dependency>
				<groupId>io.earcam.utilitarian</groupId>
				<artifactId>io.earcam.utilitarian.security</artifactId>
				<version>${version.earcam.utilitarian}</version>
			</dependency>

			<dependency>
				<groupId>io.earcam.utilitarian</groupId>
				<artifactId>io.earcam.utilitarian.log.slf4j</artifactId>
				<version>${version.earcam.utilitarian}</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>org.ow2.asm</groupId>
				<artifactId>asm</artifactId>
				<version>${version.asm}</version>
			</dependency>

			<dependency>
				<groupId>org.ow2.asm</groupId>
				<artifactId>asm-tree</artifactId>
				<version>${version.asm}</version>
			</dependency>

			<dependency>
				<groupId>org.ow2.asm</groupId>
				<artifactId>asm-commons</artifactId>
				<version>${version.asm}</version>
			</dependency>

			<dependency>
				<groupId>org.ow2.asm</groupId>
				<artifactId>asm-analysis</artifactId>
				<version>${version.asm}</version>
			</dependency>

			<dependency>
				<groupId>org.ow2.asm</groupId>
				<artifactId>asm-util</artifactId>
				<version>${version.asm}</version>
			</dependency>

			<dependency>
				<groupId>org.objenesis</groupId>
				<artifactId>objenesis</artifactId>
				<version>${version.objenesis}</version>
			</dependency>

			<dependency>
				<groupId>cglib</groupId>
				<artifactId>cglib</artifactId>
				<version>${version.cglib}</version>
				<exclusions>
					<exclusion>
						<groupId>org.apache.ant</groupId>
						<artifactId>ant</artifactId>
					</exclusion>
				</exclusions>
			</dependency>

			<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>${version.junit4}</version>
				<scope>test</scope>
				<exclusions>
					<exclusion>
						<groupId>org.hamcrest</groupId>
						<artifactId>hamcrest-core</artifactId>
					</exclusion>
				</exclusions>
			</dependency>

			<dependency>
				<groupId>org.bouncycastle</groupId>
				<artifactId>bcprov-ext-jdk15on</artifactId>
				<version>${version.bouncy.castle}</version>
			</dependency>
	
			<dependency>
				<groupId>org.bouncycastle</groupId>
				<artifactId>bcprov-jdk15on</artifactId>
				<version>${version.bouncy.castle}</version>
			</dependency>
	
			<dependency>
				<groupId>org.bouncycastle</groupId>
				<artifactId>bcpkix-jdk15on</artifactId>
				<version>${version.bouncy.castle}</version>
			</dependency>

			<dependency>
				<groupId>org.junit.jupiter</groupId>
				<artifactId>junit-jupiter-api</artifactId>
				<version>${version.junit5}</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>org.junit.jupiter</groupId>
				<artifactId>junit-jupiter-params</artifactId>
				<version>${version.junit5}</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>org.junit.platform</groupId>
				<artifactId>junit-platform-launcher</artifactId>
				<version>${version.junit.platform}</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>org.junit.jupiter</groupId>
				<artifactId>junit-jupiter-engine</artifactId>
				<version>${version.junit5}</version>
				<scope>test</scope>
			</dependency>

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

			<dependency>
				<groupId>org.mockito</groupId>
				<artifactId>mockito-core</artifactId>
				<version>2.22.0</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>${version.slf4j}</version>
			</dependency>

			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-simple</artifactId>
				<version>${version.slf4j}</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>org.ops4j.pax.tinybundles</groupId>
				<artifactId>tinybundles</artifactId>
				<version>3.0.0</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>javax.inject</groupId>
				<artifactId>javax.inject</artifactId>
				<version>1</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>org.ops4j.pax.exam</groupId>
				<artifactId>pax-exam-junit4</artifactId>
				<version>4.11.0</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>org.ops4j.pax.exam</groupId>
				<artifactId>pax-exam-container-native</artifactId>
				<version>4.11.0</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>org.ops4j.pax.exam</groupId>
				<artifactId>pax-exam-link-mvn</artifactId>
				<version>4.11.0</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>org.ops4j.pax.url</groupId>
				<artifactId>pax-url-aether</artifactId>
				<version>2.5.4</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>org.apache.felix</groupId>
				<artifactId>org.apache.felix.framework</artifactId>
				<version>5.6.10</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>org.osgi</groupId>
				<artifactId>org.osgi.core</artifactId>
				<version>6.0.0</version>
			</dependency>

			<dependency>
				<groupId>io.earcam.wrapped</groupId>
				<artifactId>com.sun.tools.attach</artifactId>
				<version>${version.sun.tools.attach}</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>org.antlr</groupId>
				<artifactId>antlr4-runtime</artifactId>
				<version>${version.antlr}</version>
			</dependency>

			<dependency>
				<groupId>org.antlr</groupId>
				<artifactId>antlr4</artifactId>
				<version>${version.antlr}</version>
				<scope>test</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<pluginManagement>
			<plugins>
				<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.codehaus.mojo</groupId>
										<artifactId>exec-maven-plugin</artifactId>
										<versionRange>[1.5.0,)</versionRange>
										<goals>
											<goal>exec</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>

								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.antlr</groupId>
										<artifactId>antlr4-maven-plugin</artifactId>
										<versionRange>[${version.antlr},5)</versionRange>
										<goals>
											<goal>antlr4</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<execute>
											<runOnConfiguration>false</runOnConfiguration>
											<runOnIncremental>true</runOnIncremental>
										</execute>
									</action>
								</pluginExecution>

								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>com.alexecollins.maven.plugin</groupId>
										<artifactId>script-maven-plugin</artifactId>
										<versionRange>[1.0.0,)</versionRange>
										<goals>
											<goal>execute</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<execute>
											<runOnConfiguration>true</runOnConfiguration>
											<runOnIncremental>false</runOnIncremental>
										</execute>
									</action>
								</pluginExecution>

								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>com.google.code.maven-replacer-plugin</groupId>
										<artifactId>maven-replacer-plugin</artifactId>
										<versionRange>[1.4,)</versionRange>
										<goals>
											<goal>replace</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<execute>
											<runOnConfiguration>true</runOnConfiguration>
											<runOnIncremental>true</runOnIncremental>
										</execute>
									</action>
								</pluginExecution>

								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.codehaus.mojo</groupId>
										<artifactId>build-helper-maven-plugin</artifactId>
										<versionRange>[3,4)</versionRange>
										<goals>
											<goal>add-source</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<execute>
											<runOnConfiguration>true</runOnConfiguration>
										</execute>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.8.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.felix</groupId>
					<artifactId>maven-bundle-plugin</artifactId>
					<version>4.0.0</version>
					<extensions>true</extensions>
					<configuration>
						<archive>
							<addMavenDescriptor>true</addMavenDescriptor>
						</archive>
						<supportedProjectTypes>
							<supportedProjectType>jar</supportedProjectType>
						</supportedProjectTypes>
						<supportIncrementalBuild>true</supportIncrementalBuild>
						<niceManifest>true</niceManifest>
						<instructions>
							<Automatic-Module-Name>${project.artifactId}</Automatic-Module-Name>
							<Bundle-Vendor>${project.developers[0].name} -
								${project.organization.name}</Bundle-Vendor>
							<Bundle-ContactAddress>${project.organization.url}</Bundle-ContactAddress>
							<Bundle-Description>${project.description}</Bundle-Description>
							<Bundle-DocURL>${project.url}</Bundle-DocURL>
							<Bundle-Category>${project.groupId}</Bundle-Category>
							<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
							<Bundle-Version>${project.version}</Bundle-Version>

							<Import-Package>!javax.annotation,*</Import-Package>
							<Export-Package>${project.artifactId}*</Export-Package>
						</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.1.0</version>
					<configuration>
						<archive>
							<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
						</archive>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.22.0</version>
					<inherited>true</inherited>
					<executions>
						<execution>
							<id>default-test</id>
							<goals>
								<goal>test</goal>
							</goals>
						</execution>
						<execution>
							<id>jdk9-test</id>
							<goals>
								<goal>test</goal>
							</goals>
							<configuration>
								<jvm>${java.home.9}/bin/java</jvm>
							</configuration>
						</execution>
						<execution>
							<id>jdk10-test</id>
							<goals>
								<goal>test</goal>
							</goals>
							<configuration>
								<jvm>${java.home.10}/bin/java</jvm>
							</configuration>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-failsafe-plugin</artifactId>
					<version>2.22.0</version>
					<inherited>true</inherited>
				</plugin>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>exec-maven-plugin</artifactId>
					<version>1.6.0</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-enforcer-plugin</artifactId>
					<version>3.0.0-M1</version>
				</plugin>

				<plugin>
					<groupId>org.antlr</groupId>
					<artifactId>antlr4-maven-plugin</artifactId>
					<version>${version.antlr}</version>
					<executions>
						<execution>
							<goals>
								<goal>antlr4</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<generateTestSources>true</generateTestSources>
						<visitor>false</visitor>
						<listener>true</listener>
					</configuration>
				</plugin>

				<plugin>
					<groupId>com.google.code.maven-replacer-plugin</groupId>
					<artifactId>maven-replacer-plugin</artifactId>
					<version>1.4.1</version>
					<executions>
						<execution>
							<id>make-antlr4-generated-classes-package-private</id>
							<phase>process-sources</phase>
							<goals>
								<goal>replace</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<includes>
							<include>target/generated-sources/antlr4/**/*.java</include>
						</includes>
						<variableTokenValueMap>
							public class=class,public interface=interface
						</variableTokenValueMap>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>build-helper-maven-plugin</artifactId>
					<version>3.0.0</version>
				</plugin>
			</plugins>
		</pluginManagement>
		
		<!--
		<plugins>
			<plugin>
				<groupId>io.earcam.maven.plugin</groupId>
				<artifactId>io.earcam.maven.plugin.ramdisk</artifactId>
				<version>0.0.3-SNAPSHOT</version>
				<extensions>true</extensions>
			</plugin>
		</plugins>
		-->
	</build>

	<profiles>
		<profile>
			<id>site</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>

			<build>
				<defaultGoal>site</defaultGoal>

				<plugins>
					<plugin>
						<groupId>io.earcam.maven.plugin</groupId>
						<artifactId>io.earcam.maven.plugin.sitemap</artifactId>
						<version>${version.earcam.maven.plugin}</version>
						<configuration>
							<gzip>true</gzip>
							<include>^.*\.html$</include>
						</configuration>
						<executions>
							<execution>
								<id>generate-sitemap</id>
								<goals>
									<goal>sitemap</goal>
									<goal>index</goal>
								</goals>
							</execution>
						</executions>
						<extensions>true</extensions>
					</plugin>

					<plugin>
						<groupId>io.earcam.maven.plugin</groupId>
						<artifactId>io.earcam.maven.plugin.site.search.offline</artifactId>
						<version>${version.earcam.maven.plugin}</version>
						<executions>
							<execution>
								<id>copy-ui-script</id>
								<goals>
									<goal>copy-ui-script</goal>
								</goals>
							</execution>
							<execution>
								<id>generate-search-index</id>
								<goals>
									<goal>index</goal>
								</goals>
								<configuration>
									<useDefaultConfiguration>false</useDefaultConfiguration>
									<crawler>
										<mappings>
											<mapping>
												<dir>${project.reporting.outputDirectory}</dir>
												<uri>${project.distributionManagement.site.url}</uri>
											</mapping>
										</mappings>
										<steps>
											<step>
												<id>RegexFilter</id>
												<configuration>
													<include>.*</include>
													<exclude>^(.*dependenc.*|.*\/jacoco\-.*|.*\/pit-reports\/.*|.*\/404.html)$</exclude>
												</configuration>
											</step>
											<step>
												<id>ApiDocsHtmlReferenceProcessor</id>
											</step>
											<step>
												<id>XrefHtmlReferenceProcessor</id>
											</step>
											<step>
												<id>HtmlContentProcessor</id>
											</step>
											<step>
												<id>PdfContentProcessor</id>
											</step>
											<step>
												<id>SimpleTokenizer</id>
											</step>
										</steps>
									</crawler>
									<indexer>
										<id>DefaultIndexer</id>
										<configuration>
											<url>url</url>
											<outputFile>${project.reporting.outputDirectory}/search-data.json</outputFile>
											<fields>text,title,description</fields>
											<outputCharset>${project.reporting.outputEncoding}</outputCharset>
										</configuration>
									</indexer>
								</configuration>
							</execution>
						</executions>
						<extensions>true</extensions>
					</plugin>
				</plugins>
			</build>
		</profile>
					
		<profile>
			<id>site-deploy</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>

			<build>
				<defaultGoal>site-deploy</defaultGoal>
			
				<plugins>
					<plugin>
						<groupId>io.earcam.maven.plugin</groupId>
						<artifactId>io.earcam.maven.plugin.netlify</artifactId>
						<version>${version.earcam.maven.plugin}</version>
						<configuration>
							<siteName>earcam-instrumental</siteName>
							<customDomain>instrumental.earcam.io</customDomain>
							<serverId>netlify</serverId>
						</configuration>
						<executions>
							<execution>
								<id>site-deploy</id>
								<goals>
									<goal>upload</goal>
								</goals>
							</execution>
						</executions>
						<extensions>true</extensions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
