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

    <groupId>org.zkoss</groupId>
    <artifactId>zkopenlayers</artifactId>
    <version>1.0.0</version>

    <packaging>jar</packaging>
    <name>ZK OpenLayers</name>
    <description>ZK wrapper for OpenLayers 2</description>
    <url>https://github.com/connollyst/zkopenlayers</url>

    <scm>
        <url>https://github.com/connollyst/zkopenlayers</url>
        <connection>
            scm:git:git://github.com/connollyst/zkopenlayers.git
        </connection>
        <developerConnection>
            scm:git:git@github.com:connollyst/zkopenlayers.git
        </developerConnection>
        <tag>zkopenlayers-1.0.0</tag>
    </scm>

    <developers>
        <developer>
            <id>jumperchen</id>
            <name>Jumper Chen</name>
        </developer>
        <developer>
            <id>kubakudla</id>
            <name>Jakub Kudla</name>
        </developer>
        <developer>
            <id>connollyst</id>
            <name>Sean Connolly</name>
            <email>connolly.st@gmail.com</email>
            <url>http://sean.connolly.rocks</url>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>GNU General Public License (GPL) v2</name>
            <url>https://www.gnu.org/licenses/gpl-2.0.txt</url>
        </license>
    </licenses>

    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus snapshot repository</name>
            <url>
                https://oss.sonatype.org/content/repositories/snapshots
            </url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-staging</id>
            <name>Sonatype Nexus release repository</name>
            <url>
                https://oss.sonatype.org/service/local/staging/deploy/maven2
            </url>
        </repository>
    </distributionManagement>

    <properties>
        <zk.version>6.0.0</zk.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.zkoss.zk</groupId>
            <artifactId>zkplus</artifactId>
            <version>${zk.version}</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.zkoss.zk</groupId>
            <artifactId>zhtml</artifactId>
            <version>${zk.version}</version>
            <optional>true</optional>
        </dependency>
    </dependencies>

    <build>
        <testOutputDirectory>${project.build.directory}/classes</testOutputDirectory>
        <plugins>
            <plugin>
                <groupId>org.zkoss.maven</groupId>
                <artifactId>yuicompressor-maven-plugin-zk</artifactId>
                <version>1.1.6</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>compress</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3.1</version>
                <configuration>
                    <excludes>
                        <exclude>**/ctrl/**</exclude>
                        <exclude>test/**</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.3</version>
            </plugin>
            <!-- Build javadoc -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.7</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <configuration>
                            <encoding>UTF-8</encoding>
                            <charset>UTF-8</charset>
                            <show>protected</show>
                        </configuration>
                        <goals>
                            <goal>javadoc</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Release to Maven Central with passphrase -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
                </configuration>
            </plugin>
            <!-- Run test webapp with Jetty -->
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>maven-jetty-plugin</artifactId>
                <version>6.1.10</version>
                <configuration>
                    <scanIntervalSeconds>5</scanIntervalSeconds>
                    <stopKey>foo</stopKey>
                    <stopPort>9999</stopPort>
                    <webAppSourceDirectory>
                        ${basedir}/src/test/webapp
                    </webAppSourceDirectory>
                    <classesDirectory>
                        ${basedir}/target/classes
                    </classesDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <!-- Generate PGP Signatures -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.4</version>
                        <configuration>
                            <passphrase>${gpg.passphrase}</passphrase>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
