<?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>
    <!-- mvn -Ptest verify to run tests -->
    <!-- mvn -Ptest jetty:run-war to run jetty interactively -->
    <!-- mvn -Dmaven.test.skip=true clean install to install -->
    <!-- Activate the test profile in your IDE otherwise the concrete logging implementation will not be found. -->


    <!-- Note to IntelliJ users. Run mvn compile before interactively running tests. -->

    <parent>
        <groupId>net.sf.ehcache</groupId>
        <artifactId>ehcache-parent</artifactId>
        <version>2.1</version>
    </parent>
    <name>Ehcache Server</name>
    <artifactId>ehcache-server</artifactId>
    <version>1.0.0</version>
    <packaging>war</packaging>
    <description>The ehcache W3C and RESTful web services server.</description>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>src/assemble/LICENSE.txt</url>
        </license>
    </licenses>
    <url>http://ehcache.org/documentation/cache_server.html</url>
    <dependencies>
        <!-- IntelliJ Issue. Hibernate has a transitive dep on asm, but a later
        version is required for javax.ws.rs. The only thing that
         seem to work is to move asm-3.1 up the classpath. -->
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-server</artifactId>
            <scope>compile</scope>
            <version>1.1.5</version>
        </dependency>
        <dependency>
            <groupId>net.sf.ehcache</groupId>
            <artifactId>ehcache</artifactId>
            <version>[1.7.1,]</version>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.5.8</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>jaxws-rt</artifactId>
            <version>2.1.5</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.wss</groupId>
            <artifactId>xws-security</artifactId>
            <version>3.0</version>
            <scope>compile</scope>
            <exclusions>
                <!--This must be gotten manually. People can include it if they need it.-->
                <exclusion>
                    <groupId>javax.xml.crypto</groupId>
                    <artifactId>xmldsig</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>dom4j</groupId>
            <artifactId>dom4j</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>httpunit</groupId>
            <artifactId>httpunit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.sun.net.httpserver</groupId>
            <artifactId>http</artifactId>
            <version>20070405</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>3.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
            <version>1.5.8</version>
            <scope>test</scope>
        </dependency>

    </dependencies>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>war</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.3</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>checkstyle</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <configLocation>${basedir}/checkstyle/checkstyle.xml</configLocation>
                    <suppressionsLocation>${basedir}/checkstyle/suppressions.xml
                    </suppressionsLocation>
                    <headerLocation>${basedir}/checkstyle/ClassHeader.txt</headerLocation>
                    <enableRSS>false</enableRSS>
                    <linkXRef>true</linkXRef>
                    <enableRulesSummary>false</enableRulesSummary>
                    <consoleOutput>true</consoleOutput>
                    <failsOnError>true</failsOnError>
                    <failOnViolation>true</failOnViolation>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                    <enableRulesSummary>true</enableRulesSummary>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.3</version>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>checkstyle</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <configLocation>${basedir}/checkstyle/checkstyle.xml
                    </configLocation>
                    <suppressionsLocation>${basedir}/checkstyle/suppressions.xml
                    </suppressionsLocation>
                    <headerLocation>${basedir}/checkstyle/ClassHeader.txt
                    </headerLocation>
                    <enableRSS>false</enableRSS>
                    <linkXRef>true</linkXRef>
                    <consoleOutput>true</consoleOutput>
                    <failsOnError>true</failsOnError>
                    <failOnViolation>true</failOnViolation>
                    <includeTestSourceDirectory>false</includeTestSourceDirectory>
                    <enableRulesSummary>true</enableRulesSummary>
                </configuration>
            </plugin>


            <!--Conflicts with Dave Whitla's plugin with the same goal.
            Use mvn org.glassfish:maven-glassfish-plugin:run instead
            change to port 9090
            -->
            <plugin>
                <groupId>org.glassfish</groupId>
                <artifactId>maven-glassfish-plugin</artifactId>
                <version>1.0-alpha-4</version>
            </plugin>

            <plugin>
                <!-- Something in maven 2.1, deploy 2.4 or something else in the chain is causing an OOME
                on deploy. Use the following script to deploy export MAVEN_OPTS=-Xmx1024m; mvn -Dmaven.test.skip=true  deploy -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.3</version>
            </plugin>

            <!--mvn jar:jar to create this jar plugin -->
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <groupId>org.apache.maven.plugins</groupId>
                <version>2.2</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true
                            </addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true
                            </addDefaultSpecificationEntries>
                            <addClasspath>true</addClasspath>
                        </manifest>
                    </archive>
                    <excludes>
                        <exclude>**/ehcache.xml</exclude>
                    </excludes>
                    <classifier>jaronly</classifier>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.glassfish</groupId>
                <artifactId>maven-glassfish-plugin</artifactId>
                <version>1.0-alpha-4</version>
            </plugin>

            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <includes>
                        <include>**/*UnitTest.java</include>
                    </includes>
                    <excludes>
                        <exclude>**/*$*</exclude>
                    </excludes>
                    <enableAssertions>false</enableAssertions>
                    <additionalClasspathElements>
                        <additionalClasspathElement>target/classes
                        </additionalClasspathElement>
                    </additionalClasspathElements>
                    <systemProperties>
                        <property>
                            <name>net.sf.ehcache.skipUpdateCheck</name>
                            <value>true</value>
                        </property>
                        <property>
                            <name>java.awt.headless</name>
                            <value>true</value>
                        </property>
                    </systemProperties>
                </configuration>
                <executions>
                    <execution>
                        <id>integration-tests</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <includes>
                                <include>**/*Test.java</include>
                            </includes>
                            <excludes>
                                <exclude>**/*$*</exclude>
                                <exclude>**/Abstract*Test.java</exclude>
                                <exclude>**/*UnitTest.java</exclude>
                            </excludes>
                            <enableAssertions>false</enableAssertions>
                            <additionalClasspathElements>
                                <additionalClasspathElement>target/classes
                                </additionalClasspathElement>
                            </additionalClasspathElements>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!--<plugin>-->
            <!--<artifactId>maven-plugin-plugin</artifactId>-->
            <!--<configuration>-->
            <!--<goalPrefix>glassfish</goalPrefix>-->
            <!--</configuration>-->
            <!--</plugin>-->
            <!--<plugin>-->
            <!--<groupId>org.codehaus.mojo</groupId>-->
            <!--<artifactId>jaxws-maven-plugin</artifactId>-->
            <!--<configuration>-->
            <!--<sei>net.sf.ehcache.server.soap.EhcacheWebServiceEndpoint</sei>-->
            <!--<genWsdl>true</genWsdl>-->
            <!--<destDir></destDir>-->
            <!--<keep>true</keep>-->
            <!--<verbose>true</verbose>-->
            <!--</configuration>-->
            <!--<executions>-->
            <!--<execution>-->
            <!--<phase>verify</phase>-->
            <!--<goals>-->
            <!--<goal>wsgen</goal>-->
            <!--</goals>-->
            <!--<configuration>-->
            <!--<sei>net.sf.ehcache.server.soap.EhcacheWebServiceEndpoint</sei>-->
            <!--<genWsdl>true</genWsdl>-->
            <!--<keep>true</keep>-->
            <!--<verbose>true</verbose>-->
            <!--</configuration>-->
            <!--</execution>-->
            <!--</executions>-->
            <!--</plugin>-->
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <filters>
                        <filter>src/assemble/filter.properties</filter>
                    </filters>
                    <descriptors>
                        <descriptor>src/assemble/distribution.xml</descriptor>
                    </descriptors>
                </configuration>
                <!--<executions>-->
                <!--<execution>-->
                <!--<id>assemble</id>-->
                <!--<phase>process-classes</phase>-->
                <!--<goals>-->
                <!--<goal>assembly</goal>-->
                <!--</goals>-->
                <!--</execution>-->
                <!--</executions>-->
            </plugin>

        </plugins>
    </build>

    <profiles>
        <profile>
            <id>test</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <dependencies>
                <!--With slf4j, users choose a concrete logging implementation at deploy time, which they provide-->
                <dependency>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-jdk14</artifactId>
                    <version>1.5.8</version>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                        <artifactId>cargo-maven2-plugin</artifactId>
                        <version>0.3.1</version>
                        <configuration>
                            <wait>false</wait>
                            <container>
                                <containerId>jetty6x</containerId>
                                <type>embedded</type>
                                <systemProperties>
                                    <com.sun.management.jmxremote/>
                                    <com.sun.management.jmxremote.port>8999
                                    </com.sun.management.jmxremote.port>
                                    <com.sun.management.jmxremote.ssl>false
                                    </com.sun.management.jmxremote.ssl>
                                    <com.sun.management.jmxremote.authenticate>false
                                    </com.sun.management.jmxremote.authenticate>
                                    <java.rmi.server.hostname>localhost
                                    </java.rmi.server.hostname>
                                    <com.sun.management.jmxremote>true
                                    </com.sun.management.jmxremote>
                                    <Ron>noR</Ron>
                                </systemProperties>
                            </container>
                            <configuration>
                                <properties>
                                    <cargo.servlet.port>9090</cargo.servlet.port>
                                </properties>
                            </configuration>
                        </configuration>

                        <executions>
                            <execution>
                                <id>start-server</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>start</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>stop-server</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>stop</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.mortbay.jetty</groupId>
                        <artifactId>maven-jetty-plugin</artifactId>
                        <version>6.1.11</version>
                        <configuration>
                            <systemProperties>
                                <systemProperty>
                                    <name>jetty.port</name>
                                    <value>9090</value>
                                </systemProperty>
                                <systemProperty>
                                    <name>com.sun.management.jmxremote</name>
                                    <value>true</value>
                                </systemProperty>
                                <systemProperty>
                                    <name>com.sun.management.jmxremote.port</name>
                                    <value>8999</value>
                                </systemProperty>
                                <systemProperty>
                                    <name>com.sun.management.jmxremote.ssl</name>
                                    <value>true</value>
                                </systemProperty>
                                <systemProperty>
                                    <name>com.sun.management.jmxremote.authenticate</name>
                                    <value>false</value>
                                </systemProperty>
                                <systemProperty>
                                    <name>java.rmi.server.hostname</name>
                                    <value>localhost</value>
                                </systemProperty>
                            </systemProperties>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <properties>
    </properties>
    <repositories>
        <repository>
            <id>java.net</id>
            <url>http://download.java.net/maven/1</url>
            <layout>legacy</layout>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
                <updatePolicy>daily</updatePolicy>
            </snapshots>
        </repository>
        <repository>
            <id>glassfish-repository</id>
            <name>Java.net Repository for Glassfish</name>
            <url>http://download.java.net/maven/glassfish</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
                <updatePolicy>daily</updatePolicy>
            </snapshots>
        </repository>
        <repository>
            <id>java.net2</id>
            <name>Java.net Maven2 Repository</name>
            <url>http://download.java.net/maven/2</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
                <updatePolicy>daily</updatePolicy>
            </snapshots>
        </repository>
        <!--Turn off snapshots. We always build against a released Cache version-->
        <!--<repository>-->
            <!--<id>sourceforge-snapshots</id>-->
            <!--<url>http://oss.sonatype.org/content/repositories/sourceforge-snapshots</url>-->
            <!--<snapshots>-->
                <!--<enabled>true</enabled>-->
                <!--<updatePolicy>always</updatePolicy>-->
            <!--</snapshots>-->
        <!--</repository>-->
        <!--<repository>-->
            <!--<id>sonatype-nexus-snapshots</id>-->
            <!--<name>sonatype-nexus-snapshots</name>-->
            <!--<url>http://oss.sonatype.org/content/repositories/snapshots</url>-->
            <!--<snapshots>-->
                <!--<enabled>true</enabled>-->
                <!--<updatePolicy>daily</updatePolicy>-->
            <!--</snapshots>-->
        <!--</repository>-->
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>maven2.java.net</id>
            <name>Java.net Repository for Maven 2</name>
            <url>http://download.java.net/maven/2</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
                <updatePolicy>daily</updatePolicy>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <distributionManagement>
        <!--
            The server id here defined must also appear in ~/.m2/settings.xml with username
            Note: site URL repeated here to ensure correct deployment path -->
        <repository>
            <id>sourceforge-releases</id>
            <name>Sourceforge Release Repository</name>
            <url>http://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
        <snapshotRepository>
            <id>sourceforge-snapshots</id>
            <name>Sourceforge Snapshot Repository</name>
            <url>http://oss.sonatype.org/content/repositories/sourceforge-snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <!--<modules>-->
    <!--<module>ehcache-server-packaging</module>-->
    <!--</modules>-->
</project>
