<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2010-2013 Ning, Inc.
  ~
  ~ Ning licenses this file to you under the Apache License, version 2.0
  ~ (the "License"); you may not use this file except in compliance with the
  ~ License.  You may obtain a copy of the License at:
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
  ~ License for the specific language governing permissions and limitations
  ~ under the License.
  -->

<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>com.ning.billing</groupId>
        <artifactId>killbill</artifactId>
        <version>0.1.67-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <artifactId>killbill-server</artifactId>
    <name>killbill-server</name>
    <packaging>war</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <guice.version>3.0</guice.version>
        <jersey.version>1.12</jersey.version>
        <jetty.version>8.1.2.v20120308</jetty.version>
        <logback.version>1.0.1</logback.version>
        <metrics.version>2.1.2</metrics.version>
        <skeleton.version>0.1.7</skeleton.version>
        <async-http-client.version>1.7.1</async-http-client.version>
    </properties>

    <dependencies>
        <!-- Jetty test scope -->
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-http</artifactId>
            <version>${jetty.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-io</artifactId>
            <version>${jetty.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-util</artifactId>
            <version>${jetty.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-server</artifactId>
            <version>${jetty.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-deploy</artifactId>
            <version>${jetty.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-jmx</artifactId>
            <version>${jetty.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-xml</artifactId>
            <version>${jetty.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- NOT in master POM; include version as well -->
        <dependency>
            <groupId>org.weakref</groupId>
            <artifactId>jmxutils</artifactId>
            <version>1.12</version>
        </dependency>
        <dependency>
            <groupId>com.google.inject.extensions</groupId>
            <artifactId>guice-servlet</artifactId>
            <version>${guice.version}</version>
        </dependency>
        <dependency>
            <groupId>com.yammer.metrics</groupId>
            <artifactId>metrics-core</artifactId>
            <version>${metrics.version}</version>
        </dependency>
        <dependency>
            <groupId>com.yammer.metrics</groupId>
            <artifactId>metrics-guice</artifactId>
            <version>${metrics.version}</version>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-server</artifactId>
            <version>${jersey.version}</version>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey.contribs</groupId>
            <artifactId>jersey-guice</artifactId>
            <version>${jersey.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ning.jetty</groupId>
            <artifactId>ning-service-skeleton-base</artifactId>
            <version>${skeleton.version}</version>
        </dependency>
        <dependency>
            <groupId>com.ning.jetty</groupId>
            <artifactId>ning-service-skeleton-jdbi</artifactId>
            <version>${skeleton.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ning</groupId>
            <artifactId>async-http-client</artifactId>
            <version>${async-http-client.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>${slf4j.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <version>${logback.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
            <scope>runtime</scope>
        </dependency>

        <!-- FROM MASTER POM / LIBRARY -->
        <dependency>
            <groupId>com.ning.billing</groupId>
            <artifactId>killbill-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ning.billing</groupId>
            <artifactId>killbill-account</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ning.billing</groupId>
            <artifactId>killbill-jaxrs</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ning.billing</groupId>
            <artifactId>killbill-beatrix</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ning.billing</groupId>
            <artifactId>killbill-util</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ning.billing</groupId>
            <artifactId>killbill-entitlement</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ning.billing</groupId>
            <artifactId>killbill-invoice</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ning.billing</groupId>
            <artifactId>killbill-payment</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ning.billing</groupId>
            <artifactId>killbill-catalog</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ning.billing</groupId>
            <artifactId>killbill-analytics</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ning.billing</groupId>
            <artifactId>killbill-junction</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ning.billing</groupId>
            <artifactId>killbill-overdue</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ning.billing</groupId>
            <artifactId>killbill-tenant</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ning.billing</groupId>
            <artifactId>killbill-usage</artifactId>
        </dependency>
        <dependency>
            <groupId>com.ning.billing</groupId>
            <artifactId>killbill-osgi</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency><!-- Needed by jmxutils -->
            <groupId>com.google.inject.extensions</groupId>
            <artifactId>guice-multibindings</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.antlr</groupId>
            <artifactId>stringtemplate</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.skife.config</groupId>
            <artifactId>config-magic</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.shiro</groupId>
            <artifactId>shiro-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.ning.billing</groupId>
            <artifactId>killbill-util</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.ning.billing</groupId>
            <artifactId>killbill-beatrix</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.ning.billing</groupId>
            <artifactId>killbill-payment</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-mxj</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-mxj-db-files</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <resources>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>io.tesla.jettyconsole</groupId>
                <artifactId>jetty-console-maven-plugin</artifactId>
                <version>1.47</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>createconsole</goal>
                        </goals>
                        <configuration>
                            <backgroundImage>${basedir}/src/main/jettyconsole/killbill.png</backgroundImage>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <executions>
                    <execution>
                        <id>assemble-killbill</id>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <createSourcesJar>true</createSourcesJar>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <shadedClassifierName>jar-with-dependencies</shadedClassifierName>
                            <filters>
                                <filter>
                                    <artifact>${project.groupId}:${project.artifactId}</artifact>
                                </filter>
                            </filters>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- To make eclipse happy -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version>
                <configuration>
                    <attachClasses>true</attachClasses>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>${jetty.version}</version>
                <dependencies>
                    <!-- Needed to redirect Jetty logs to slf4j -->
                    <dependency>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                        <version>${slf4j.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>ch.qos.logback</groupId>
                        <artifactId>logback-core</artifactId>
                        <version>${logback.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>ch.qos.logback</groupId>
                        <artifactId>logback-classic</artifactId>
                        <version>${logback.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.eclipse.jetty</groupId>
                        <artifactId>jetty-deploy</artifactId>
                        <version>${jetty.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.eclipse.jetty</groupId>
                        <artifactId>jetty-jmx</artifactId>
                        <version>${jetty.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <jettyXml>${basedir}/src/main/jetty-config/ning-jetty-conf.xml</jettyXml>
                    <contextXml>${basedir}/src/main/jetty-config/contexts/root.xml</contextXml>
                    <systemProperties>
                        <systemProperty>
                            <!-- See root.xml -->
                            <name>xn.jetty.webapps.defaultsDescriptor</name>
                            <value>${basedir}/src/main/jetty-config/etc/webdefault.xml</value>
                        </systemProperty>
                        <systemProperty>
                            <name>logback.configurationFile</name>
                            <value>file:${basedir}/src/main/resources/logback.xml</value>
                        </systemProperty>
                    </systemProperties>
                    <scanIntervalSeconds>0</scanIntervalSeconds>
                    <stopPort>9966</stopPort>
                    <stopKey>foo</stopKey>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
