<?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>io.katharsis</groupId>
        <artifactId>katharsis-parent</artifactId>
        <version>3.0.2</version>
        <relativePath>../katharsis-parent</relativePath>
    </parent>

    <groupId>io.katharsis</groupId>
    <artifactId>katharsis-servlet</artifactId>
    <packaging>bundle</packaging>

    <name>${project.groupId}:${project.artifactId}</name>
    <url>https://github.com/katharsis-project/katharsis-servlet</url>
    <description>Generic Servlet Adapter of Katharsis JSON:API middleware library</description>
    <scm>
        <url>https://github.com/katharsis-project/katharsis-framework</url>
        <connection>scm:git:git://github.com/katharsis-project/katharsis-framework.git</connection>
        <developerConnection>scm:git:git@github.com:katharsis-project/katharsis-framework.git</developerConnection>
    </scm>
    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/katharsis-project/katharsis-framework/issues</url>
    </issueManagement>
    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <organization>Katharsis community</organization>
        </developer>
    </developers>

    <properties>

        <javax.servlet-api.version>3.0.1</javax.servlet-api.version>
        <guava.version>15.0</guava.version>

        <lib.slf4j.version>1.7.6</lib.slf4j.version>
        <lib.log4j.version>1.2.17</lib.log4j.version>

        <spring.version>3.2.12.RELEASE</spring.version>
        <json-unit.version>1.5.5</json-unit.version>

        <maven-jetty-plugin.version>6.1.10</maven-jetty-plugin.version>

    </properties>

    <repositories>
        <repository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>http://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <dependencies>

        <dependency>
            <groupId>io.katharsis</groupId>
            <artifactId>katharsis-core</artifactId>
            <version>${project.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>${javax.servlet-api.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${lib.slf4j.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${lib.slf4j.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>${lib.slf4j.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>${lib.log4j.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>net.javacrumbs.json-unit</groupId>
            <artifactId>json-unit</artifactId>
            <version>${json-unit.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>${maven-surefire-report-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>${cobertura-maven-plugin.version}</version>
                <configuration>
                    <formats>
                        <format>html</format>
                        <format>xml</format>
                    </formats>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                    <systemPropertyVariables>
                        <java.util.logging.config.file>logging.properties</java.util.logging.config.file>
                    </systemPropertyVariables>
                    <runOrder>alphabetical</runOrder>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.eluder.coveralls</groupId>
                <artifactId>coveralls-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <instructions>
                        <Export-Package>io.katharsis.invoker.*,io.katharsis.servlet.*</Export-Package>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>

        <!--
          You can run `mvn -Prun clean veryfy' for easier testing at http://localhost:8080/katharsis/.
          Also, you can run the following for remote debugging:

          $ export MAVEN_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
          $ mvn -Prun
        -->

        <profile>

            <id>run</id>

            <dependencies>

                <dependency>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                    <version>${lib.slf4j.version}</version>
                </dependency>

                <dependency>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                    <version>${lib.slf4j.version}</version>
                    <scope>runtime</scope>
                </dependency>

                <dependency>
                    <groupId>org.slf4j</groupId>
                    <artifactId>jcl-over-slf4j</artifactId>
                    <version>${lib.slf4j.version}</version>
                    <scope>runtime</scope>
                </dependency>

                <dependency>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                    <version>${lib.log4j.version}</version>
                    <scope>runtime</scope>
                </dependency>

            </dependencies>

            <build>
                <defaultGoal>initialize</defaultGoal>
                <plugins>
                    <plugin>
                        <groupId>org.mortbay.jetty</groupId>
                        <artifactId>maven-jetty-plugin</artifactId>
                        <version>${maven-jetty-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>cargo-run</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <contextPath>/katharsis</contextPath>
                            <webAppSourceDirectory>${basedir}/src/test/webapp</webAppSourceDirectory>
                            <classesDirectory>${basedir}/target/classes,${basedir}/target/test-classes
                            </classesDirectory>
                            <systemProperties>
                                <systemProperty>
                                    <name>log4j.configuration</name>
                                    <value>file://${basedir}/src/test/resources/log4j.xml</value>
                                </systemProperty>
                            </systemProperties>
                        </configuration>
                    </plugin>
                </plugins>
            </build>

        </profile>

    </profiles>

</project>
