<?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.7</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>1.1.7</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>11</java.version>

        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>

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

		<selenium.version>3.141.59</selenium.version>
        <webdrivermanager.version>3.6.1</webdrivermanager.version>

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

        <substeps.framework.version>1.1.8</substeps.framework.version>

        <slf4j.version>1.7.26</slf4j.version>

		<guava.version>28.1-jre</guava.version>
		<mockito.version>3.0.0</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.8.4</jacoco.maven.plugin.version>
        <htmlunit.driver.version>2.35.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
		-->

        <scala.major.version>2.12</scala.major.version>
        <scala.version>${scala.major.version}.10</scala.version>
        <scala-test.version>3.0.8</scala-test.version>
        <scala-mock.version>4.4.0</scala-mock.version>
        <scala.plugin.version>4.0.2</scala.plugin.version>


    </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>
            <exclusions>
                <exclusion>
                    <groupId>com.google.guava</groupId>
                    <artifactId>guava</artifactId>
                </exclusion>
            </exclusions>

		</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>
            <exclusions>
                <exclusion>
                    <groupId>com.google.guava</groupId>
                    <artifactId>guava</artifactId>
                </exclusion>
            </exclusions>
		</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>

            <exclusions>
                <exclusion>
                    <groupId>net.bytebuddy</groupId> <!-- 1.8.15 -->
                    <artifactId>byte-buddy</artifactId>
                </exclusion>

            </exclusions>

        </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>${slf4j.version}</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>${webdrivermanager.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>com.typesafe</groupId>
                    <artifactId>config</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- SCALA -->
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.version}</version>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-reflect</artifactId>
            <version>${scala.version}</version>
        </dependency>

        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_2.12</artifactId>
            <version>${scala-test.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.scalamock</groupId>
            <artifactId>scalamock_${scala.major.version}</artifactId>
            <version>${scala-mock.version}</version>
            <scope>test</scope>
        </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>

                </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>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                                <!-- 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.8.1</version>

                <configuration>
                    <release>11</release>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>

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

                <configuration>
                    <detectLinks />
                    <verbose>true</verbose>
                    <failOnError>false</failOnError>

                    <!-- this is necessary so that the javadoc process doesn't grumble about the scala classes ref'd in the java classes -->
                    <additionalDependencies>
                        <additionalDependency>
                            <groupId>org.substeps</groupId>
                            <artifactId>webdriver-substeps</artifactId>
                            <version>${project.version}</version>
                            <systemPath>${project.build.outputDirectory}/webdriver-substeps.jar</systemPath>
                        </additionalDependency>
                    </additionalDependencies>

                    <tags>

                        <tag>
                            <name>org.substeps.step.section</name>
                            <placement>a</placement>
                            <head>Category:</head>
                        </tag>

                        <tag>
                            <name>org.substeps.step.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.substeps</groupId>
                <artifactId>substeps-maven-plugin</artifactId>
                <version>${substeps.framework.version}</version>

                <executions>
                    <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.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<version>2.22.2</version>
				<executions>
					<execution>
						<goals>
							<goal>integration-test</goal>
							<goal>verify</goal>
						</goals>
					</execution>
				</executions>

                <configuration>
                    <argLine>
                        --illegal-access=permit
                    </argLine>

                </configuration>

			</plugin>


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

                    <argLine>
                        --illegal-access=permit
                    </argLine>

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

                    <autoReleaseAfterClose>true</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>

                    <!--<localCheckout>true</localCheckout>-->

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


            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>${scala.plugin.version}</version>
                <executions>

                    <!-- Run scala compiler in the process-resources phase, so that dependencies on scala classes can be
                        resolved later in the (Java) compile phase -->
                    <execution>
                        <id>scala-compile-first</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>add-source</goal>
                            <goal>compile</goal>
                        </goals>
                    </execution>

                    <!-- Run scala compiler in the process-test-resources phase, so that dependencies on scala classes can
                        be resolved later in the (Java) test-compile phase -->
                    <execution>
                        <id>scala-test-compile</id>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>

                </executions>
                <configuration>
                    <sourceDir>src/main/scala</sourceDir>
                    <jvmArgs>
                        <jvmArg>-Xms64m</jvmArg>
                        <jvmArg>-Xmx1024m</jvmArg>
                    </jvmArgs>
                    <scalaVersion>${scala.version}</scalaVersion>
                    <!-- <args> <arg>-make:transitive</arg> <arg>dependenfile</arg> <arg>${project.build.directory}/.scala_dependencies</arg>
                        </args> -->

                    
                </configuration>
            </plugin>



            <plugin>
                <groupId>org.scalatest</groupId>
                <artifactId>scalatest-maven-plugin</artifactId>
                <version>2.0.0</version>
                <configuration>
                    <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                    <junitxml>.</junitxml>
                    <filereports>WDF TestSuite.txt</filereports>
                </configuration>
                <executions><execution>
                    <id>test</id>
                    <goals><goal>test</goal></goals>
                </execution></executions>
            </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>
