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

    <parent>
        <groupId>org.testatoo</groupId>
        <artifactId>parent-pom</artifactId>
        <version>1.0.0</version>
    </parent>

    <groupId>org.testatoo</groupId>
    <artifactId>testatoo-selenium-server</artifactId>
    <version>1.0.0_1.0.2</version>
    <packaging>jar</packaging>

    <name>${project.artifactId}</name>
    <description>Selenium server repackaged</description>

    <properties>
        <jdk>1.5</jdk>
    </properties>

    <scm>
        <connection>scm:svn:https://svn.ovea.com/internal/ovea/testatoo/selenium-server/tags/testatoo-selenium-server-1.0.0_1.0.2</connection>
        <developerConnection>scm:svn:https://svn.ovea.com/internal/ovea/testatoo/selenium-server/tags/testatoo-selenium-server-1.0.0_1.0.2</developerConnection>
        <url>https://svn.ovea.com/internal/ovea/testatoo/selenium-server/tags/testatoo-selenium-server-1.0.0_1.0.2</url>
    </scm>

    <dependencies>
        <!-- packages in the jar file -->
        <dependency>
            <groupId>org.testatoo.openqa</groupId>
            <artifactId>selenium-server</artifactId>
            <version>1.0.2_20090715_patched</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.testatoo.openqa</groupId>
            <artifactId>selenium-java-client-driver</artifactId>
            <version>1.0.2_20090715</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.14</version>
            <scope>provided</scope>
        </dependency>
        <!-- sadly, selenium server comes with a buggy version of commons-logging.
        This one will be put before on the classpath to take precedence over it. -->
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1.1</version>
            <scope>provided</scope>
        </dependency>
        <!-- testing -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.6</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.4</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>testatoo-selenium-server</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>org.testatoo.selenium.server.Start</mainClass>
                        </manifest>
                        <manifestEntries>
                            <Class-Path>.</Class-Path>
                            <Selenium-Version>${seleniumVersion}</Selenium-Version>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <configuration>
                    <excludeResources>true</excludeResources>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <configuration>
                    <silent>true</silent>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <configuration>
                            <tasks>
                                <jar update="true" file="${project.build.directory}/${project.build.finalName}.jar">
                                    <zipfileset prefix="org/testatoo/selenium/server/embedded" dir="${project.build.directory}/dependency" includes="selenium-server-1.0.2_20090715_patched.jar" />
                                    <zipfileset prefix="org/testatoo/selenium/server/embedded" dir="${project.build.directory}/dependency" includes="commons-logging-1.1.1.jar" />
                                    <zipfileset prefix="org/testatoo/selenium/server/embedded" dir="${project.build.directory}/dependency" includes="log4j-1.2.14.jar" />
                                </jar>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.mycila.maven-license-plugin</groupId>
                <artifactId>maven-license-plugin</artifactId>
                <version>1.5.0</version>
                <configuration>
                    <header>${basedir}/etc/header.txt</header>
                    <failIfMissing>true</failIfMissing>
                    <properties>
                        <owner>Ovea</owner>
                        <year>${project.inceptionYear}</year>
                        <email>dev@testatoo.org</email>
                    </properties>
                    <excludes>
                        <exclude>LICENSE.txt</exclude>
                        <exclude>src/test/resources/**</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
