<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <artifactId>workflow-servlet</artifactId>
    <packaging>jar</packaging>

    <name>Workflow: Servlet</name>
    <description>
        Provides a Java servlet that exposes a workflow service via a simple RESTful interface.
    </description>

    <parent>
        <groupId>com.svbio.workflow</groupId>
        <artifactId>workflow</artifactId>
        <version>1.0.0.0-SNAPSHOT</version>
    </parent>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <!-- Annotation processing is done with the maven-process-plugin. Unfortunately, adding a
                         dependencies sections to the maven-compiler-plugin has no effect, so the annotation processors
                         would have to be declared as ordinary optional dependencies (in the main dependency section).
                         That is clearly undesirable.
                         External documentation of the issue: http://stackoverflow.com/q/26228563 -->
                    <proc>none</proc>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <configuration>
                    <usedDependencies>
                        <usedDependency>org.glassfish.jersey.containers:jersey-container-servlet</usedDependency>
                        <usedDependency>org.slf4j:slf4j-simple</usedDependency>
                    </usedDependencies>
                </configuration>
            </plugin>

            <!-- The maven-processor-plugin is used to run annotation processors. See comments for
                 maven-compiler-plugin. -->
            <plugin>
                <groupId>org.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <!-- It is not necessary to explicitly specify annotation processors as there is a discovery
                                 mechanism, but we do it anyway to avoid a warning by the maven-processor-plugin. -->
                            <processors>
                                <processor>dagger.internal.codegen.ComponentProcessor</processor>
                            </processors>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.google.dagger</groupId>
                        <artifactId>dagger-compiler</artifactId>
                        <version>${dagger.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>com.svbio.workflow</groupId>
            <artifactId>workflow-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.svbio.workflow</groupId>
            <artifactId>workflow-service</artifactId>
        </dependency>

        <dependency>
            <groupId>xyz.cloudkeeper.core</groupId>
            <artifactId>cloudkeeper-model</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
        </dependency>

        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.dagger</groupId>
            <artifactId>dagger</artifactId>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>

        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
        </dependency>

        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-server</artifactId>
        </dependency>
        <dependency>
            <!-- Note that this dependency exists (only) because the test code uses jersey-client. So the dependency
                 plugin would raise an error if jersey-client was not listed. However, jersey-client is also a
                 transitive dependency of jersey-server (with scope 'compile'), so the scope has to be 'compile' and not
                 'test'. The scope specified here overrides the scope specified in the transitive dependency. -->
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.containers</groupId>
            <artifactId>jersey-container-servlet-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.containers</groupId>
            <artifactId>jersey-container-servlet</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-moxy</artifactId>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-server</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-servlet</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
