<?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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>org.substeps</groupId>
	<artifactId>webdriver-substeps</artifactId>
	<version>1.1.1</version>

	<packaging>jar</packaging>
	<name>Webdriver Substeps</name>
	<description>Webdriver specific implementations of Substeps</description>
    	<url>https://github.com/Substeps/substeps-webdriver</url>

    <scm>
        <connection>scm:git:https://github.com:Substeps/substeps-webdriver.git</connection>
        <developerConnection>scm:git:git@github.com:Substeps/substeps-webdriver.git</developerConnection>
        <url>https://github.com/Substeps/substeps-webdriver.git</url>

        <tag>HEAD</tag>
    </scm>


    <organization>
        <name>Substeps</name>
        <url>https://github.com/Substeps/</url>
    </organization>


    <!--
        Original organization
        <organization>
            <name>Technophobia Ltd</name>
            <url>www.technophobia.com/</url>
        </organization>
    -->

	<licenses>
		<license>
		    <name>LGPL 3.0 license</name>
		    <url>http://www.opensource.org/licenses/lgpl-3.0.html</url>
		    <distribution>manual</distribution>
		</license>
	</licenses>

    <developers>
        <developer>
          <id>iantmoore</id>
          <name>Ian Moore</name>
          <organization>Technophobia</organization>
          <roles>
            <role>architect</role>
            <role>developer</role>
          </roles>
        </developer>

        <developer>
          <id>rorygibson</id>
          <name>Rory Gibson</name>
          <organization>Technophobia</organization>
          <roles>
            <role>developer</role>
          </roles>
        </developer>

        <developer>
          <id>davemoss</id>
          <name>Dave Moss</name>
          <organization>Technophobia</organization>
          <roles>
            <role>developer</role>
          </roles>
        </developer>

       <developer>
          <id>stuartforbes</id>
          <name>Stu Forbes</name>
          <organization>Technophobia</organization>
          <roles>
            <role>developer</role>
          </roles>
        </developer>


       <developer>
          <id>rickybarefield</id>
          <name>Ricky Barefield</name>
          <organization>Technophobia</organization>
          <roles>
            <role>developer</role>
          </roles>
       </developer>

       <developer>
          <id>petergphillips</id>
          <name>Peter Phillips</name>
          <organization>Greenthistle.com</organization>
          <roles>
            <role>developer</role>
          </roles>
       </developer>

       <developer>
          <id>beercan1989</id>
          <name>James Bacon</name>
          <organization>G2G3 Digital</organization>
          <url>https://github.com/beercan1989</url>
          <roles>
            <role>developer</role>
          </roles>
        </developer>

    </developers>

	<properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>

        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

		<selenium.version>3.4.0</selenium.version>

		<hamcrest.version>1.3</hamcrest.version>
		<junit.version>4.12</junit.version>

        <substeps.framework.version>1.1.1</substeps.framework.version>

        <slf4j.version>1.7.13</slf4j.version>

		<guava.version>21.0</guava.version>
		<mockito.version>2.7.19</mockito.version>

 		<sonar.jacoco.reportPath>${basedir}/jacoco.exec</sonar.jacoco.reportPath>
		<sonar.jacoco.itReportPath>${basedir}/target/jacoco-it.exec</sonar.jacoco.itReportPath>
		<sonar.jacoco.jar>${basedir}/jacoco/jacocoagent.jar</sonar.jacoco.jar>

 		<!--<sonar.phase>post-integration-test</sonar.phase>-->
		<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
		<!--<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>-->

        <!-- TODO how to get code coverage during the self-test phase -->

<!--
        <jacoco.maven.plugin.version>0.7.9</jacoco.maven.plugin.version>
-->

        <jacoco.maven.plugin.version>0.7.5.201505241946</jacoco.maven.plugin.version>
<!--
		<jacoco.maven.plugin.version>0.5.3.201107060350</jacoco.maven.plugin.version>
-->

        <htmlunit.driver.version>2.23.1</htmlunit.driver.version> <!-- latest is 2.27 -->

		<!-- THESE PROPERTIES NEED TO BE DEFINED IN AN ACTIVE PROFILE IN SETTINGS.XML
		EG.
        <nexus.snapshot.artifacts>snapshots</nexus.snapshot.artifacts>
        <nexus.release.artifacts>releases</nexus.release.artifacts>
        <nexus.snapshot.url>http://someserver.com/${nexus.snapshot.artifacts}/</nexus.snapshot.url>
        <nexus.releases.url>http://someserver.com/${nexus.release.artifacts}/</nexus.releases.url>
		<webdriver-substeps.scm>scm:git:git://github.com/${your username}/webdriver-substeps.git</webdriver-substeps.scm>
        webdriver-substeps.scm.url
		-->

	</properties>

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

        <repository>
            <id>oss</id>
            <url>https://oss.sonatype.org/content/repositories/releases/</url>
        </repository>

    </distributionManagement>


    <pluginRepositories>
		<pluginRepository>
			<id>sonatype-nexus-snapshots</id>
			<name>Sonatype Nexus Snapshots</name>
			<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
			<snapshots>
				<updatePolicy>always</updatePolicy>
			</snapshots>
		</pluginRepository>

        <pluginRepository>
            <id>sonatype-nexus-releass</id>
            <name>Sonatype Nexus Releases</name>
            <url>https://oss.sonatype.org/content/repositories/releases/</url>
        </pluginRepository>


    </pluginRepositories>

	<dependencies>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
        </dependency>

		<dependency>
			<groupId>org.substeps</groupId>
			<artifactId>substeps-core-api</artifactId>
			<version>${substeps.framework.version}</version>
		</dependency>

		<!-- Dependency on core must be TEST scope only -->
		<dependency>
			<groupId>org.substeps</groupId>
			<artifactId>substeps-core</artifactId>
			<version>${substeps.framework.version}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.substeps</groupId>
			<artifactId>substeps-junit-runner</artifactId>
			<version>${substeps.framework.version}</version>
			<scope>test</scope>
		</dependency>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>htmlunit-driver</artifactId>
            <version>${htmlunit.driver.version}</version>
        </dependency>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-support</artifactId>
            <version>${selenium.version}</version>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>

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

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.25</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
        </dependency>


			<!-- TEST DEPENDENCIES -->

		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-core</artifactId>
			<version>${hamcrest.version}</version>

		</dependency>

		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-library</artifactId>
			<version>${hamcrest.version}</version>

		</dependency>


		<dependency>
			<groupId>org.seleniumhq.selenium</groupId>
			<artifactId>selenium-java</artifactId>
			<version>${selenium.version}</version>
		</dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.1</version>
        </dependency>

        <!-- required for HTMLUnit -->
        <dependency>
            <groupId>org.eclipse.jetty.websocket</groupId>
            <artifactId>websocket-client</artifactId>
            <version>9.4.0.v20161208</version>
        </dependency>

        <!-- required for HTML Unit to open SSL Connections -->
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.5.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.typesafe</groupId>
            <artifactId>config</artifactId>
            <version>1.3.1</version>
        </dependency>

        <dependency>
            <groupId>io.github.bonigarcia</groupId>
            <artifactId>webdrivermanager</artifactId>
            <version>1.7.1</version>
            <exclusions>
                <exclusion>
                    <groupId>com.typesafe</groupId>
                    <artifactId>config</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

	</dependencies>

    <profiles>

        <profile>
            <id>self-test</id>
            <!--<activation>-->
                <!--<activeByDefault>true</activeByDefault>-->
            <!--</activation>-->

            <build>

                <plugins>

                    <plugin>
                        <groupId>org.substeps</groupId>
                        <artifactId>substeps-maven-plugin</artifactId>
                        <version>${substeps.framework.version}</version>

                        <executions>
                            <execution>
                                <id>SubSteps Test</id>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>run-features</goal>
                                </goals>
                                <configuration>

                                </configuration>
                            </execution>

                            <execution>
                                <id>Build SubSteps Report</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>build-report</goal>
                                </goals>
                            </execution>

                            <execution>
                                <id>Build SubSteps Glossary</id>
                                <phase>process-test-resources</phase>
                                <goals>
                                    <goal>generate-docs</goal>
                                </goals>
                            </execution>

                        </executions>

                        <dependencies>

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

                        </dependencies>
                    </plugin>

                    <plugin>
                        <groupId>org.sonarsource.scanner.maven</groupId>
                        <artifactId>sonar-maven-plugin</artifactId>
                        <version>3.0.1</version>
                    </plugin>


<!--                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${jacoco.maven.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>default-prepare-agent</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>prepare-agent-integration</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>default-report</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>report-integration</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>default-check</id>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                                <configuration>
                                    <rules>

                                        <rule>
                                            <element>BUNDLE</element>
                                            <limits>
                                                <limit>
                                                    <counter>CLASS</counter>
                                                    <value>COVEREDRATIO</value>
                                                    <minimum>0.20</minimum>
                                                </limit>
                                            </limits>
                                        </rule>
                                    </rules>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
-->


                </plugins>

            </build>
        </profile>


        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- Release Configuration -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>

                                <!-- TODO: Add Travis-CI configuration for GPG access -->
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>



    </profiles>

	<build>
		<finalName>${project.artifactId}</finalName>
		<plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>

                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>


			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>2.3.2</version>

				<configuration>
					<localCheckout>true</localCheckout>
					<pushChanges>false</pushChanges>
				</configuration>
			</plugin>


		 	<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.3</version>

                <configuration>
                    <detectLinks />
                    <tags>
                        <tag>
                            <name>section</name>
                            <placement>a</placement>
                            <head>Category:</head>
                        </tag>

                        <tag>
                            <name>example</name>
                            <placement>a</placement>
                            <head>Example usage in substeps:</head>
                        </tag>
                    </tags>
                </configuration>

                <executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<version>2.8</version>
				<executions>
					<execution>
						<goals>
							<goal>integration-test</goal>
							<goal>verify</goal>
						</goals>
					</execution>
				</executions>
			</plugin>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <includes>
                        <include>**/*Test.java</include>
                    </includes>
                    <excludes>
                        <exclude>**/SelfTests.java</exclude>

                    </excludes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.6</version>

                <extensions>true</extensions>
                <configuration>

                    <serverId>oss.sonatype.org</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <tags>
                        <javaVersion>r${java.version}</javaVersion>
                    </tags>

                    <!-- TODO: Turn back on after first Travis release -->
                    <autoReleaseAfterClose>false</autoReleaseAfterClose>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>

                <configuration>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                    <pushChanges>false</pushChanges>
                    <!--<localCheckout>true</localCheckout>-->

                    <!-- TODO: Add Travis-CI configuration for SCM access -->
                </configuration>
            </plugin>



        </plugins>
		<pluginManagement>
			<plugins>
				<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.substeps
										</groupId>
										<artifactId>
											substeps-glossary-builder
										</artifactId>
										<versionRange>
											[1.1.2,)
										</versionRange>
										<goals>
											<goal>generate-docs</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-report-plugin</artifactId>
				<!--<version>2.5</version>-->
				<reportSets>
					<reportSet>
						<reports>
							<report>report-only</report>
						</reports>
						<configuration>
							<reportsDirectories>
								<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
								<reportsDirectory>${project.build.directory}/failsafe-reports</reportsDirectory>
							</reportsDirectories>
						</configuration>
					</reportSet>
				</reportSets>
			</plugin>
		</plugins>
	</reporting>

</project>
