<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>
    <groupId>com.github.crashvb</groupId>
    <artifactId>chromedriver</artifactId>
    <version>2.37</version>
    <description>Package chromedriver as maven artifact</description>
    <scm>
        <url>https://github.com/crashvb/chromedriver.git</url>
        <connection>scm:git:git://github.com/crashvb/chromedriver.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/crashvb/chromedriver.git</developerConnection>
        <tag>HEAD</tag>
    </scm>
    <developers>
        <developer>
            <name>Igor Sukhorukov</name>
            <url>http://suhorukov.blogspot.ru</url>
            <email>igor.suhorukov[skip this] at gmail.com</email>
        </developer>
        <developer>
            <name>Richard Davis</name>
            <email>crashvb[skip this] at gmail.com</email>
        </developer>
    </developers>
    <licenses>
        <license>
            <name>Chromedriver license</name>
            <url>https://chromium.googlesource.com/chromium/src/+/afb2b4d227b36874c5a165565afbdc6d36daddd5/chrome/test/chromedriver/third_party/googlecode/LICENSE</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <properties>
        <chromedriver.version>2.37</chromedriver.version>
        <chromedriver.win32.md5>00c991baa1e51abf6d582aedae91291f</chromedriver.win32.md5>
        <chromedriver.mac64.md5>5e68436af99f9348d67127e5ab8d5eed</chromedriver.mac64.md5>
        <chromedriver.linux64.md5>f4fbbf50eaec2b9c9e21536e39b9999e</chromedriver.linux64.md5>
    </properties>
    <build>
        <plugins>
            <plugin>
                <groupId>com.googlecode.maven-download-plugin</groupId>
                <artifactId>download-maven-plugin</artifactId>
                <version>1.2.1</version>
                <executions>
                    <execution>
                        <id>download-win</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>https://chromedriver.storage.googleapis.com/${chromedriver.version}/chromedriver_win32.zip</url>
                            <unpack>true</unpack>
                            <outputDirectory>${project.build.directory}/win</outputDirectory>
                            <md5>${chromedriver.win32.md5}</md5>
                        </configuration>
                    </execution>
                    <execution>
                        <id>download-linux64</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>https://chromedriver.storage.googleapis.com/${chromedriver.version}/chromedriver_linux64.zip</url>
                            <unpack>true</unpack>
                            <outputDirectory>${project.build.directory}/linux64</outputDirectory>
                            <md5>${chromedriver.linux64.md5}</md5>
                        </configuration>
                    </execution>
                    <execution>
                        <id>download-mac64</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>https://chromedriver.storage.googleapis.com/${chromedriver.version}/chromedriver_mac64.zip</url>
                            <unpack>true</unpack>
                            <outputDirectory>${project.build.directory}/mac64</outputDirectory>
                            <md5>${chromedriver.mac64.md5}</md5>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.10</version>
                <executions>
                    <execution>
                        <id>attach-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>${project.build.directory}/win/chromedriver.exe</file>
                                    <type>bin</type>
                                    <classifier>win32</classifier>
                                </artifact>
                                <artifact>
                                    <file>${project.build.directory}/linux64/chromedriver</file>
                                    <type>bin</type>
                                    <classifier>linux64</classifier>
                                </artifact>
                                <artifact>
                                    <file>${project.build.directory}/mac64/chromedriver</file>
                                    <type>bin</type>
                                    <classifier>mac64</classifier>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
