<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>5.0.15</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:https://github.com/bhecquet/seleniumRobot-drivers.git</connection>
        <developerConnection>scm:git:https://github.com/bhecquet/seleniumRobot-drivers.git</developerConnection>
		<!-- <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-5.0.15</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://msedgedriver.azureedge.net</edgedriver.url> root URL give all paths -->
		<edgedriver.url>https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver</edgedriver.url> <!-- root URL give all paths -->
		<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>
                        <!-- BEGIN_DRIVER_DEFINITION -->
                            <!-- CHROMEDRIVER: pattern for file MUST BE chromedriver_<version>_chrome-<minChromeVersion>-<maxChromeVersion> -->
            
                            <execution>
                                <id>chromedriver 97</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <url>${chromedriver.url}/97.0.4692.71/chromedriver_${chromedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_chromedriver_97.0_chrome-97-98</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>chromedriver 98</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <url>${chromedriver.url}/98.0.4758.102/chromedriver_${chromedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_chromedriver_98.0_chrome-98-99</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>chromedriver 99</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <url>${chromedriver.url}/99.0.4844.51/chromedriver_${chromedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_chromedriver_99.0_chrome-99-100</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>chromedriver 100</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <url>${chromedriver.url}/100.0.4896.60/chromedriver_${chromedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_chromedriver_100.0_chrome-100-101</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>chromedriver 101</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <url>${chromedriver.url}/101.0.4951.41/chromedriver_${chromedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_chromedriver_101.0_chrome-101-102</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>chromedriver 102</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <url>${chromedriver.url}/102.0.5005.61/chromedriver_${chromedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_chromedriver_102.0_chrome-102-103</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>chromedriver 103</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <url>${chromedriver.url}/103.0.5060.134/chromedriver_${chromedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_chromedriver_103.0_chrome-103-104</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>chromedriver 104</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <url>${chromedriver.url}/104.0.5112.79/chromedriver_${chromedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_chromedriver_104.0_chrome-104-105</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>chromedriver 105</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <url>${chromedriver.url}/105.0.5195.52/chromedriver_${chromedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_chromedriver_105.0_chrome-105-106</outputDirectory>
                                </configuration>
                            </execution>
                            <!-- EDGEDRIVER: pattern for file MUST BE edgedriver_<version>_edge-<minEdgeVersion>-<maxEdgeVersion> -->
            
                            <execution>
                                <id>edgedriver 98</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <skip>${is.not.windows}</skip>
                                    <url>${edgedriver.url}/98.0.1108.92/edgedriver_${edgedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_edgedriver_98.0_edge-98-99</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>edgedriver 99</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <skip>${is.not.windows}</skip>
                                    <url>${edgedriver.url}/99.0.1150.55/edgedriver_${edgedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_edgedriver_99.0_edge-99-100</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>edgedriver 100</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <skip>${is.not.windows}</skip>
                                    <url>${edgedriver.url}/100.0.1185.60/edgedriver_${edgedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_edgedriver_100.0_edge-100-101</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>edgedriver 101</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <skip>${is.not.windows}</skip>
                                    <url>${edgedriver.url}/101.0.1210.53/edgedriver_${edgedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_edgedriver_101.0_edge-101-102</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>edgedriver 102</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <skip>${is.not.windows}</skip>
                                    <url>${edgedriver.url}/102.0.1245.62/edgedriver_${edgedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_edgedriver_102.0_edge-102-103</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>edgedriver 103</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <skip>${is.not.windows}</skip>
                                    <url>${edgedriver.url}/103.0.1264.77/edgedriver_${edgedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_edgedriver_103.0_edge-103-104</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>edgedriver 104</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <skip>${is.not.windows}</skip>
                                    <url>${edgedriver.url}/104.0.1293.70/edgedriver_${edgedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_edgedriver_104.0_edge-104-105</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>edgedriver 105</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <skip>${is.not.windows}</skip>
                                    <url>${edgedriver.url}/105.0.1343.17/edgedriver_${edgedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_edgedriver_105.0_edge-105-106</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>edgedriver 106</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <skip>${is.not.windows}</skip>
                                    <url>${edgedriver.url}/106.0.1367.0/edgedriver_${edgedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_edgedriver_106.0_edge-106-107</outputDirectory>
                                </configuration>
                            </execution>                     
<!-- END_DRIVER_DEFINITION -->                      
                        <!-- GECKODRIVER -->
                        <execution>
                            <id>geckodriver 0.31.0</id>
                            <phase>generate-resources</phase>
                            <goals>
                                <goal>wget</goal>
                            </goals>
                            <configuration>
                                <url>${geckodriver.url}/v0.31.0/geckodriver-v0.31.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>https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.2.0/IEDriverServer_x64_4.2.0.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>https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.2.0/IEDriverServer_Win32_4.2.0.zip</url>
                                <outputDirectory>${driver.path}${os}/dir_IEDriverServer_Win32</outputDirectory>
                            </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>
							<argument>${skip.clean.driver}</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>
