<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.infotel.seleniumRobot</groupId>
	<artifactId>seleniumRobot-drivers</artifactId>
	<packaging>pom</packaging>
	<version>4.0.36</version>
	
	<name>seleniumRobot drivers</name>
	<description>Drivers which must be deployed with seleniumRobot core or with seleniumRobot grid</description>
	<url>https://github.com/bhecquet/seleniumRobot-drivers</url>

	<licenses>
		<license>
			<name>The Apache License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
		</license>
	</licenses>
	
	<developers>
		<developer>
			<name>Bertrand Hecquet</name>
			<email>bertrand.hecquet@org.com</email>
			<organization>org</organization>
			<organizationUrl>http://www.org.com</organizationUrl>
		</developer>
	</developers>
	
	<scm>
		<connection>scm:git:git@github.com:bhecquet/seleniumRobot-drivers.git</connection>
		<developerConnection>scm:git:git@github.com:bhecquet/seleniumRobot-drivers.git</developerConnection>
		<url>git@github.com:bhecquet/seleniumRobot-drivers.git</url>
		<tag>seleniumRobot-drivers-4.0.36</tag>
	</scm>
	
	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>
	
	<repositories>
		<repository>
			<id>central</id>
			<name>Maven Repository Switchboard</name>
			<layout>default</layout>
			<url>http://repo1.maven.org/maven2</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
	</repositories>

	<properties>
		<os>linux</os>
		<is.not.windows>true</is.not.windows>
		<root.path>${project.basedir}</root.path>
		<driver.path>${root.path}/src/main/resources/drivers/</driver.path>
		<chromedriver.url>https://chromedriver.storage.googleapis.com</chromedriver.url>
		<geckodriver.url>https://github.com/mozilla/geckodriver/releases/download</geckodriver.url>
		<iedriver.url>http://selenium-release.storage.googleapis.com</iedriver.url>
		<edgedriver.url>https://download.microsoft.com/download</edgedriver.url>
		<chromedriver.suffix />
		<geckodriver.suffix />
		<geckodriver.ext />
		<skip.clean.driver>false</skip.clean.driver>
		<skip.custom.driver>true</skip.custom.driver>
		<selenium.version>3.14.0</selenium.version>
	</properties>

	<modules>
		<module>seleniumRobot-windows-driver</module>
		<module>seleniumRobot-linux-driver</module>
		<module>seleniumRobot-mac-driver</module>
	</modules>

	<dependencies>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>2.4</version>
		</dependency>
	</dependencies>

	<build>
		<finalName>${project.artifactId}</finalName>
		<pluginManagement>
			<plugins>
					
				<plugin>
					<groupId>com.googlecode.maven-download-plugin</groupId>
					<artifactId>download-maven-plugin</artifactId>
					<version>1.3.0</version>

					<configuration>
						<unpack>true</unpack>
					</configuration>
					<executions>

						<!-- CHROMEDRIVER: pattern for file MUST BE chromedriver_<version>_chrome-<minChromeVersion>-<maxChromeVersion> -->
						<execution>
							<id>chromedriver 89.0</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>wget</goal>
							</goals>
							<configuration>
								<url>${chromedriver.url}/89.0.4389.23/chromedriver_${chromedriver.suffix}.zip</url>
								<outputDirectory>${driver.path}${os}/dir_chromedriver_89.0_chrome-89-90</outputDirectory>
							</configuration>
                        </execution>
						<execution>
							<id>chromedriver 88.0</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>wget</goal>
							</goals>
							<configuration>
								<url>${chromedriver.url}/88.0.4324.96/chromedriver_${chromedriver.suffix}.zip</url>
								<outputDirectory>${driver.path}${os}/dir_chromedriver_88.0_chrome-88-89</outputDirectory>
							</configuration>
                        </execution>
						<execution>
							<id>chromedriver 87.0</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>wget</goal>
							</goals>
							<configuration>
								<url>${chromedriver.url}/87.0.4280.88/chromedriver_${chromedriver.suffix}.zip</url>
								<outputDirectory>${driver.path}${os}/dir_chromedriver_87.0_chrome-87-88</outputDirectory>
							</configuration>
                        </execution>
						<execution>
							<id>chromedriver 86.0</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>wget</goal>
							</goals>
							<configuration>
								<url>${chromedriver.url}/86.0.4240.22/chromedriver_${chromedriver.suffix}.zip</url>
								<outputDirectory>${driver.path}${os}/dir_chromedriver_86.0_chrome-86-87</outputDirectory>
							</configuration>
                        </execution>
						<execution>
							<id>chromedriver 85.0</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>wget</goal>
							</goals>
							<configuration>
								<url>${chromedriver.url}/85.0.4183.83/chromedriver_${chromedriver.suffix}.zip</url>
								<outputDirectory>${driver.path}${os}/dir_chromedriver_85.0_chrome-85-86</outputDirectory>
							</configuration>
                        </execution>
                        <execution>
							<id>chromedriver 84.0</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>wget</goal>
							</goals>
							<configuration>
								<url>${chromedriver.url}/84.0.4147.30/chromedriver_${chromedriver.suffix}.zip</url>
								<outputDirectory>${driver.path}${os}/dir_chromedriver_84.0_chrome-84-84</outputDirectory>
							</configuration>
                        </execution>
						<!-- Chromedriver 77.0 (77.0.3865.40) does not work with Salesforce: https://bugs.chromium.org/p/chromedriver/issues/detail?id=3103 -->
                        <execution>
							<id>chromedriver 83.0</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>wget</goal>
							</goals>
							<configuration>
								<url>${chromedriver.url}/83.0.4103.39/chromedriver_${chromedriver.suffix}.zip</url>
								<outputDirectory>${driver.path}${os}/dir_chromedriver_83.0_chrome-83-83</outputDirectory>
							</configuration>
                        </execution>
                        <execution>
							<id>chromedriver 81.0</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>wget</goal>
							</goals>
							<configuration>
								<url>${chromedriver.url}/81.0.4044.69/chromedriver_${chromedriver.suffix}.zip</url>
								<outputDirectory>${driver.path}${os}/dir_chromedriver_81.0_chrome-81-81</outputDirectory>
							</configuration>
                        </execution>
						<execution>
							<id>chromedriver 2.29</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>wget</goal>
							</goals>
							<configuration>
								<url>${chromedriver.url}/2.29/chromedriver_${chromedriver.suffix}.zip</url>
								<outputDirectory>${driver.path}${os}/dir_chromedriver_2.29_chrome-56-58_android-7.0</outputDirectory>
							</configuration>
						</execution>
						

						<!-- GECKODRIVER -->
						<execution>
							<id>geckodriver 0.28.0</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>wget</goal>
							</goals>
							<configuration>
								<url>${geckodriver.url}/v0.28.0/geckodriver-v0.28.0-${geckodriver.suffix}${geckodriver.ext}</url>
								<outputDirectory>${driver.path}${os}/dir_geckodriver</outputDirectory>
							</configuration>
						</execution>

						<!-- IEDriverServer -->
						<execution>
							<id>IEDriverServer 64</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>wget</goal>
							</goals>
							<configuration>
								<skip>${is.not.windows}</skip>
								<!-- <url>${iedriver.url}/${selenium.version.short}/IEDriverServer_x64_${selenium.version.short}.0.zip</url>-->
								<url>${iedriver.url}/3.141/IEDriverServer_x64_3.141.5.zip</url>
								<outputDirectory>${driver.path}${os}/dir_IEDriverServer_x64</outputDirectory>
							</configuration>
						</execution>
						<execution>
							<id>IEDriverServer 32</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>wget</goal>
							</goals>
							<configuration>
								<skip>${is.not.windows}</skip>
								<url>${iedriver.url}/3.141/IEDriverServer_Win32_3.141.5.zip</url>
								<outputDirectory>${driver.path}${os}/dir_IEDriverServer_Win32</outputDirectory>
							</configuration>
						</execution>
						
						<!-- Edge driver -->
						<execution>
							<id>Edge driver 17134</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>wget</goal>
							</goals>
							<configuration>
								<skip>${is.not.windows}</skip>
								<url>${edgedriver.url}/F/8/A/F8AF50AB-3C3A-4BC4-8773-DC27B32988DD/MicrosoftWebDriver.exe</url>
								<outputDirectory>${driver.path}${os}/dir_MicrosoftWebDriver_17134</outputDirectory>
								<unpack>false</unpack>
							</configuration>
						</execution>
						<execution>
							<id>Edge driver 16299</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>wget</goal>
							</goals>
							<configuration>
								<skip>${is.not.windows}</skip>
								<url>${edgedriver.url}/D/4/1/D417998A-58EE-4EFE-A7CC-39EF9E020768/MicrosoftWebDriver.exe</url>
								<outputDirectory>${driver.path}${os}/dir_MicrosoftWebDriver_16299</outputDirectory>
								<unpack>false</unpack>
							</configuration>
						</execution>
						<execution>
							<id>Edge driver 15063</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>wget</goal>
							</goals>
							<configuration>
								<skip>${is.not.windows}</skip>
								<url>${edgedriver.url}/3/4/2/342316D7-EBE0-4F10-ABA2-AE8E0CDF36DD/MicrosoftWebDriver.exe</url>
								<outputDirectory>${driver.path}${os}/dir_MicrosoftWebDriver_15063</outputDirectory>
								<unpack>false</unpack>
							</configuration>
						</execution>
						<execution>
							<id>Edge driver 14393</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>wget</goal>
							</goals>
							<configuration>
								<skip>${is.not.windows}</skip>
								<url>${edgedriver.url}/3/2/D/32D3E464-F2EF-490F-841B-05D53C848D15/MicrosoftWebDriver.exe</url>
								<outputDirectory>${driver.path}${os}/dir_MicrosoftWebDriver_14393</outputDirectory>
								<unpack>false</unpack>
							</configuration>
						</execution>						
					</executions>
				</plugin>
				<plugin>
					<artifactId>maven-resources-plugin</artifactId>
					<version>3.1.0</version>
					<executions>
						<execution>
							<id>copy-custom-drivers</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>copy-resources</goal>
							</goals>
							<configuration>
                                                            <overwrite>true</overwrite>
								<skip>${skip.custom.driver}</skip>
								<outputDirectory>${driver.path}${os}</outputDirectory>
								<resources>
									<resource>
										<directory>${project.basedir}/custom</directory>
									</resource>
								</resources>
							</configuration>            
						</execution>
						<execution>
							<id>default-resources</id>
							<phase>process-resources</phase>
							<goals>
								<goal>resources</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>2.6</version>
					<configuration>
						<finalName>${project.artifactId}</finalName>
						<archive>
							<manifest>
								<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
	                			<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
							</manifest>
						</archive>
					</configuration>
					<executions>
						<execution>
							<id>default-jar</id>
							<goals>
								<goal>jar</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.5.1</version>
					<executions>
						<execution>
							<id>default-compile</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>compile</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<encoding>utf-8</encoding>
						<source>1.8</source>
						<target>1.8</target>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>exec-maven-plugin</artifactId>
					<version>1.6.0</version>
					<executions>
						<execution>
							<phase>generate-resources</phase>
							<goals>
								<goal>java</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<mainClass>fr.covea.seleniumRobot.driversdownload.MoveDrivers</mainClass>
						<arguments>
							<argument>${driver.path}</argument>
							<argument>${os}</argument>
						</arguments>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>build-helper-maven-plugin</artifactId>
					<version>3.0.0</version>
					<executions>
						<execution>
							<id>regex-property</id>
							<goals>
								<goal>regex-property</goal>
							</goals>
							<phase>generate-sources</phase>
							<configuration>
	
								<name>selenium.version.short</name>
								<value>${selenium.version}</value>
								<regex>^([0-9]+)\.([0-9]+)\.([0-9]+)(-SNAPSHOT)?$</regex>
								<replacement>$1.$2</replacement>
								<failIfNoMatch>true</failIfNoMatch>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
				    <artifactId>maven-antrun-plugin</artifactId>
				    <version>1.7</version>
				    <executions>
				        <execution>
				        	<id>generate-driver-list</id>
				            <phase>compile</phase>
				            <configuration>
				                <target>
				                    <fileset id="driver-fileset" dir="src/main/resources/drivers" />
				                    <pathconvert targetos="unix" pathsep="," property="driver-file-list" refid="driver-fileset">
				                        <map from="${project.basedir}/src/main/resources/drivers/" to="" />
				                    </pathconvert>
				                    <echo file="${project.basedir}/target/classes/driver-list-${os}.txt">${driver-file-list}</echo>
				                </target>
				            </configuration>
				            <goals>
				                <goal>run</goal>
				            </goals>
				        </execution>
				        <execution>
				        	<id>generate-os-specific-class</id>
				            <phase>generate-sources</phase>
				            <configuration>
				                <target>
				                	<copy todir="${project.basedir}/src/main/java/fr/covea/seleniumRobot/driversdownload/" overwrite="true">
									  <fileset dir="${project.basedir}/../src/main/java/fr/covea/seleniumRobot/driversdownload/" />
									</copy>
				                    <echo file="${project.basedir}/src/main/java/fr/covea/seleniumRobot/driversdownload/HelloDriver${os}.java">package fr.covea.seleniumRobot.driversdownload;public class HelloDriver${os} {}</echo>
				                </target>
				            </configuration>
				            <goals>
				                <goal>run</goal>
				            </goals>
				        </execution>
				    </executions>
				</plugin>
				<plugin>
			        <groupId>org.apache.maven.plugins</groupId>
			        <artifactId>maven-source-plugin</artifactId>
			        <version>3.0.1</version>
			        <executions>
			          <execution>
			            <id>attach-sources</id>
			            <goals>
			              <goal>jar</goal>
			            </goals>
			            <configuration>
			            	<excludeResources>true</excludeResources>
			            </configuration>
			          </execution>
			        </executions>
			      </plugin>
			</plugins>
			
		</pluginManagement>
		<plugins>
			<plugin>
		     	<groupId>org.sonatype.plugins</groupId>
		        <artifactId>nexus-staging-maven-plugin</artifactId>
		        <version>1.6.3</version>
		        <extensions>true</extensions>
		        <configuration>
		        	<serverId>ossrh</serverId>
		        	<nexusUrl>https://oss.sonatype.org/</nexusUrl>
		        	<autoReleaseAfterClose>true</autoReleaseAfterClose>
		        </configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>1.5</version>
				<executions>
					<execution>
						<id>sign-artifacts</id>
						<phase>verify</phase>
						<goals>
							<goal>sign</goal>
						</goals>
						<configuration>
							<keyname>${gpg.keyname}</keyname>
							<passphraseServerId>${gpg.keyname}</passphraseServerId>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-release-plugin</artifactId>
				<version>2.5.2</version>
				<dependencies>
					<dependency>
						<groupId>org.apache.maven.scm</groupId>
						<artifactId>maven-scm-provider-gitexe</artifactId>
						<version>1.8.1</version>
					</dependency>
				</dependencies>
				<configuration>
					<autoVersionSubmodules>true</autoVersionSubmodules>
				</configuration>
			</plugin>
		</plugins>
	</build>

</project>
