<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.1.52</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.1.52</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://msedgedriver.microsoft.com</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>
						<!-- Chrome version for Android 14 -->
						<execution>
							<id>chromedriver 113</id>
							<phase>generate-resources</phase>
							<goals>
								<goal>wget</goal>
							</goals>
							<configuration>
								<url>${chromedriver.url}/113.0.5672.63/chromedriver_${oldchromedriver.suffix}.zip</url>
								<outputDirectory>${driver.path}${os}/dir_chromedriver_113.0_chrome-113-114</outputDirectory>
							</configuration>
						</execution>
					<execution>
		                                <id>chromedriver 120</id>
		                                <phase>generate-resources</phase>
		                                <goals>
		                                    <goal>wget</goal>
		                                </goals>
		                                <configuration>
		                                    <url>https://storage.googleapis.com/chrome-for-testing-public//120.0.6099.109/${chromedriver.suffix}/chromedriver-${chromedriver.suffix}.zip</url>
		                                    <outputDirectory>${driver.path}${os}/dir_chromedriver_120.0_chrome-120-121</outputDirectory>
		                                </configuration>
		                            </execution>
                        <!-- BEGIN_DRIVER_DEFINITION -->
                            <!-- CHROMEDRIVER: pattern for file MUST BE chromedriver_<version>_chrome-<minChromeVersion>-<maxChromeVersion> -->
            
                            <execution>
                                <id>chromedriver 151</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <url>https://storage.googleapis.com/chrome-for-testing-public//151.0.7896.0/${chromedriver.suffix}/chromedriver-${chromedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_chromedriver_151.0_chrome-151-152</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>chromedriver 150</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <url>https://storage.googleapis.com/chrome-for-testing-public//150.0.7871.24/${chromedriver.suffix}/chromedriver-${chromedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_chromedriver_150.0_chrome-150-151</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>chromedriver 149</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <url>https://storage.googleapis.com/chrome-for-testing-public//149.0.7827.155/${chromedriver.suffix}/chromedriver-${chromedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_chromedriver_149.0_chrome-149-150</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>chromedriver 148</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <url>https://storage.googleapis.com/chrome-for-testing-public//148.0.7778.178/${chromedriver.suffix}/chromedriver-${chromedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_chromedriver_148.0_chrome-148-149</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>chromedriver 147</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <url>https://storage.googleapis.com/chrome-for-testing-public//147.0.7727.117/${chromedriver.suffix}/chromedriver-${chromedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_chromedriver_147.0_chrome-147-148</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>chromedriver 146</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <url>https://storage.googleapis.com/chrome-for-testing-public//146.0.7680.165/${chromedriver.suffix}/chromedriver-${chromedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_chromedriver_146.0_chrome-146-147</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>chromedriver 145</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <url>https://storage.googleapis.com/chrome-for-testing-public//145.0.7632.117/${chromedriver.suffix}/chromedriver-${chromedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_chromedriver_145.0_chrome-145-146</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>chromedriver 144</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <url>https://storage.googleapis.com/chrome-for-testing-public//144.0.7559.133/${chromedriver.suffix}/chromedriver-${chromedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_chromedriver_144.0_chrome-144-145</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>chromedriver 143</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <url>https://storage.googleapis.com/chrome-for-testing-public//143.0.7499.192/${chromedriver.suffix}/chromedriver-${chromedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_chromedriver_143.0_chrome-143-144</outputDirectory>
                                </configuration>
                            </execution>
                            <!-- EDGEDRIVER: pattern for file MUST BE edgedriver_<version>_edge-<minEdgeVersion>-<maxEdgeVersion> -->
            
                            <execution>
                                <id>edgedriver 143</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <skip>${is.not.windows}</skip>
                                    <url>${edgedriver.url}/143.0.3650.139/edgedriver_${edgedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_edgedriver_143.0_edge-143-144</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>edgedriver 144</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <skip>${is.not.windows}</skip>
                                    <url>${edgedriver.url}/144.0.3719.162/edgedriver_${edgedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_edgedriver_144.0_edge-144-145</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>edgedriver 145</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <skip>${is.not.windows}</skip>
                                    <url>${edgedriver.url}/145.0.3800.97/edgedriver_${edgedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_edgedriver_145.0_edge-145-146</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>edgedriver 146</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <skip>${is.not.windows}</skip>
                                    <url>${edgedriver.url}/146.0.3856.152/edgedriver_${edgedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_edgedriver_146.0_edge-146-147</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>edgedriver 147</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <skip>${is.not.windows}</skip>
                                    <url>${edgedriver.url}/147.0.3912.98/edgedriver_${edgedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_edgedriver_147.0_edge-147-148</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>edgedriver 148</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <skip>${is.not.windows}</skip>
                                    <url>${edgedriver.url}/148.0.3967.118/edgedriver_${edgedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_edgedriver_148.0_edge-148-149</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>edgedriver 149</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <skip>${is.not.windows}</skip>
                                    <url>${edgedriver.url}/149.0.4022.69/edgedriver_${edgedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_edgedriver_149.0_edge-149-150</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>edgedriver 150</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <skip>${is.not.windows}</skip>
                                    <url>${edgedriver.url}/150.0.4078.13/edgedriver_${edgedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_edgedriver_150.0_edge-150-151</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>edgedriver 151</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>wget</goal>
                                </goals>
                                <configuration>
                                    <skip>${is.not.windows}</skip>
                                    <url>${edgedriver.url}/151.0.4100.0/edgedriver_${edgedriver.suffix}.zip</url>
                                    <outputDirectory>${driver.path}${os}/dir_edgedriver_151.0_edge-151-152</outputDirectory>
                                </configuration>
                            </execution>                     
<!-- END_DRIVER_DEFINITION -->                      
                        <!-- GECKODRIVER -->
                        <execution>
                            <id>geckodriver 0.33.0</id>
                            <phase>generate-resources</phase>
                            <goals>
                                <goal>wget</goal>
                            </goals>
                            <configuration>
                                <url>${geckodriver.url}/v0.33.0/geckodriver-v0.33.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>
						<excludes>
							<exclude>**/driversdownload/*</exclude>
						</excludes>
					</configuration>
					<executions>
						<execution>
							<id>default-jar</id>
							<goals>
								<goal>jar</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
				    <groupId>org.apache.maven.plugins</groupId>
				    <artifactId>maven-javadoc-plugin</artifactId>
				    <version>3.6.0</version>
				    <dependencies>
				        <dependency>
                            <groupId>org.apache.commons</groupId>
                            <artifactId>commons-text</artifactId>
                            <version>1.10.0</version>	        
				        </dependency>
				    </dependencies>
				</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.13</version>
		        <extensions>true</extensions>
		        <configuration>
		        	<serverId>ossrh</serverId>
		        	<nexusUrl>https://ossrh-staging-api.central.sonatype.com</nexusUrl>
		        	<autoReleaseAfterClose>true</autoReleaseAfterClose>
                    <stagingProgressTimeoutMinutes>15</stagingProgressTimeoutMinutes>
		        </configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>3.1.0</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>3.0.1</version>
				<dependencies>
					<dependency>
						<groupId>org.apache.maven.scm</groupId>
						<artifactId>maven-scm-provider-gitexe</artifactId>
						<version>2.0.1</version>
					</dependency>
				</dependencies>
				<configuration>
					<autoVersionSubmodules>true</autoVersionSubmodules>
				</configuration>
			</plugin>
		</plugins>
	</build>

</project>
