<?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>
    <parent>
        <groupId>net.sf.ehcache</groupId>
        <artifactId>ehcache-parent</artifactId>
        <version>1.5.0</version>
    </parent>
    <name>Ehcache Web Filters</name>
    <artifactId>ehcache-web</artifactId>
    <packaging>jar</packaging>
    <version>1.6.0-beta1</version>
    <description><![CDATA[Web caching filters.]]> </description>
    <dependencies>
        <dependency>
            <groupId>${pom.groupId}</groupId>
            <artifactId>ehcache</artifactId>
            <version>[1.5,1.6]</version>
        </dependency>

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


        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>dom4j</groupId>
            <artifactId>dom4j</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>httpunit</groupId>
            <artifactId>httpunit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <properties>
        <maven.test.skip>true</maven.test.skip>
    </properties>

    <profiles>
        <profile>
            <id>test</id>
            <activation>
                <property>
                    <name>env</name>
                    <value>test</value>
                </property>
            </activation>
            <properties>
                <maven.test.skip>false</maven.test.skip>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-war-plugin</artifactId>
                        <version>2.0.2</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>war</goal>
                                </goals>
                            </execution>

                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.mortbay.jetty</groupId>
                        <artifactId>maven-jetty-plugin</artifactId>
                        <version>6.1.10</version>
                        <configuration>
                            <contextPath>/</contextPath>
                            <scanIntervalSeconds>10</scanIntervalSeconds>
                            <stopKey>foo</stopKey>
                            <stopPort>9999</stopPort>
                        </configuration>
                        <executions>
                            <execution>
                                <id>start-jetty</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>run-war</goal>
                                </goals>
                                <configuration>
                                    <scanIntervalSeconds>0</scanIntervalSeconds>
                                    <daemon>true</daemon>
                                </configuration>
                            </execution>
                            <execution>
                                <id>stop-jetty</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>stop</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>


                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <inherited>true</inherited>
                        <configuration>
                            <includes>
                                <include>**/*Test.java</include>
                            </includes>
                            <excludes>
                                <exclude>**/*$*</exclude>
                                <exclude>**/web/**/*</exclude>
                                <exclude>**/Abstract*Test.java</exclude>
                                <exclude>**/constructs/web/**</exclude>
                            </excludes>
                            <forkMode>never</forkMode>
                            <childDelegation>false</childDelegation>
                            <disableXmlReport>true</disableXmlReport>
                            <printSummary>true</printSummary>
                            <reportFormat>plain</reportFormat>
                            <redirectTestOutputToFile>true</redirectTestOutputToFile>
                            <systemProperties>
                                <property>
                                    <name>java.awt.headless</name>
                                    <value>true</value>
                                </property>
                                <property>
                                    <name>
                                        net.sf.ehcache.speedAdjustmentFactor
                                    </name>
                                    <value>
                                        ${net.sf.ehcache.speedAdjustmentFactor}
                                    </value>
                                </property>
                            </systemProperties>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-tests</id>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <configuration>
                                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
                                    <forkMode>never</forkMode>
                                    <includes>
                                        <include>**/web/**/*Test.java</include>
                                    </includes>
                                    <excludes>
                                        <exclude>**/*$*</exclude>
                                    </excludes>
                                    <enableAssertions>false</enableAssertions>
                                    <useSystemClassLoader>false</useSystemClassLoader>
                                    <additionalClasspathElements>
                                        <additionalClasspathElement>target/classes</additionalClasspathElement>
                                    </additionalClasspathElements>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>

            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <!-- Doesn't work when not internet connected -->
                <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-source-plugin</artifactId>
                <version>2.0.3</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </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>
            </plugin>

            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>**/servlet/**</exclude>
                    </excludes>
                </configuration>
            </plugin>


        </plugins>
    </build>

    <contributors>
        <contributor>
            <name>Craig Andrews</name>
            <email/>
            <url/>
            <organization/>
            <organizationUrl/>
            <roles>
                <role>Developer</role>
            </roles>
            <timezone>+10</timezone>
            <properties>
                <contribution>Contributed to the CachingHeaders implementation.</contribution>
            </properties>
        </contributor>
    </contributors>

    <!-- Note: site URL repeated here to ensure correct deployment path -->
    <distributionManagement>
        <!--
          The server id here defined must also appear in ~/.m2/settings.xml with username
        -->
        <snapshotRepository>
            <id>sourceforge.net</id>
            <name>SF EHCache Snapshot Repository</name>
            <url>scp://gregluck,ehcache@web.sourceforge.net:/home/groups/e/eh/ehcache/htdocs/snapshotrepository</url>
        </snapshotRepository>

        <repository>
            <id>sourceforge.net</id>
            <name>SF EHCache Repository</name>
            <url>scp://gregluck,ehcache@web.sourceforge.net:/home/groups/e/eh/ehcache/htdocs/repository</url>
        </repository>
    </distributionManagement>

</project>
