<?xml version="1.0"?>
<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>
    <properties>
        <jbosscache-core-version>3.2.0.GA</jbosscache-core-version>
        <!-- By default only run tests in the "unit" group -->
        <defaultTestGroup>unit</defaultTestGroup>
        <!-- By default only generate Javadocs when we install the module. -->
        <javadocPhase>install</javadocPhase>
    </properties>

    <parent>
        <groupId>org.jboss.cache</groupId>
        <artifactId>jbosscache-common-parent</artifactId>
        <version>1.5</version>
    </parent>
    <groupId>org.jboss.cache</groupId>
    <artifactId>jbosscache-core</artifactId>
    <version>3.2.0.GA</version>
    <name>JBoss Cache - Core Edition</name>
    <description>JBoss Cache - Core Edition</description>
    <url>http://www.jbosscache.org</url>
    <packaging>jar</packaging>
    <dependencies>
        <dependency>
            <groupId>jgroups</groupId>
            <artifactId>jgroups</artifactId>
            <!--<version>2.8.0.Beta2</version>-->
           <version>2.6.9.GA</version>
        </dependency>

        <!--
              For the JTA 1.1 API; consuming projects can safely
              exclude this and replace with any valid source of this API, such as a Java EE app server.
        -->
        <dependency>
         <groupId>org.jboss.javaee</groupId>
         <artifactId>jboss-transaction-api</artifactId>
         <version>1.0.1.GA</version>
      </dependency>

        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1.1</version>
        </dependency>

        <dependency>
            <groupId>org.jboss</groupId>
            <artifactId>jboss-common-core</artifactId>
            <version>2.2.14.GA</version>
        </dependency>

        <!-- optional dependencies -->
        <dependency>
            <groupId>jdbm</groupId>
            <artifactId>jdbm</artifactId>
            <version>1.0</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>c3p0</groupId>
            <artifactId>c3p0</artifactId>
            <version>0.9.1.2</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.sleepycat</groupId>
            <artifactId>je</artifactId>
            <version>3.3.75</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>net.jcip</groupId>
            <artifactId>jcip-annotations</artifactId>
            <version>1.0</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>net.noderunner</groupId>
            <artifactId>amazon-s3</artifactId>
            <version>1.0.0.0</version>
            <optional>true</optional>
        </dependency>

        <!-- test dependencies -->
        <dependency>
            <groupId>hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>1.8.0.7</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymock</artifactId>
            <version>2.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jboss.jbossts</groupId>
            <artifactId>jbossjta</artifactId>
            <version>4.4.0.GA</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>beanshell</groupId>
            <artifactId>bsh</artifactId>
            <version>2.0b4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.noderunner</groupId>
            <artifactId>http</artifactId>
            <version>1.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>test</scope>
        </dependency>
        <!-- 5.8 is needed for proper parallel test execution -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>5.8</version>
            <scope>test</scope>
            <classifier>jdk15</classifier>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- ensure parallel test execution -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.4.3-JBOSS</version>
                <configuration>
                    <parallel>tests</parallel>
                    <threadCount>10</threadCount>
                    <forkMode>none</forkMode>
                    <systemProperties>
                        <property>
                            <name>jgroups.stack</name>
                            <value>${protocol.stack}</value>
                        </property>
                    </systemProperties>
                    <trimStackTrace>false</trimStackTrace>
                    <properties>
                        <property>
                            <name>listener</name>
                            <value>org.jboss.cache.util.UnitTestTestNGListener</value>
                        </property>
                    </properties>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.2-beta-1</version>
                <executions>
                    <execution>
                        <id>assemble</id>
                        <phase>install</phase>
                        <goals>
                            <goal>attached</goal>
                        </goals>
                        <configuration>
                            <descriptors>
                                <descriptor>assembly/bin.xml</descriptor>
                                <descriptor>assembly/doc.xml</descriptor>
                                <descriptor>assembly/all.xml</descriptor>
                                <descriptor>assembly/src.xml</descriptor>
                            </descriptors>
                            <finalName>${artifactId}-${jbosscache-core-version}</finalName>
                            <outputDirectory>target/distribution</outputDirectory>
                            <workDirectory>target/assembly/work</workDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <mainClass>org.jboss.cache.Version</mainClass>
                        </manifest>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <id>build-test-jar</id>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                        <configuration>
                            <archive>
                                <manifest>
                                    <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                    <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                </manifest>
                            </archive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.4.3-JBOSS</version>
            </plugin>
        </plugins>
    </reporting>

    <!-- basic JBoss repository so that the common parent POM in jbosscache-support can be found -->
    <repositories>
        <repository>
            <id>repository.jboss.org</id>
            <url>http://repository.jboss.org/maven2</url>
        </repository>
        <repository>
            <id>snapshots.jboss.org</id>
            <url>http://snapshots.jboss.org/maven2</url>
        </repository>
        <!-- For Amazon S3 artifacts -->
        <repository>
            <id>e-xml.sourceforge.net</id>
            <url>http://e-xml.sourceforge.net/maven2/repository</url>
        </repository>
        <!-- For Sleepycat -->
        <repository>
            <id>berkeleydb-je.repository</id>
            <url>http://download.oracle.com/maven/</url>
        </repository>
    </repositories>

    <profiles>
        <profile>
            <!-- This testMoreState generates Javadocs and the UserGuide, FAQs and Tutorial in the "package" phase. -->
            <id>Docs</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <!-- override to generate javadocs in the "package" phase -->
                <javadocPhase>package</javadocPhase>
            </properties>
            <build>
                <plugins>
                    <!-- the docbook generation plugin for the user guide -->
                    <plugin>
                        <groupId>org.jboss.maven.plugins</groupId>
                        <artifactId>maven-jdocbook-plugin</artifactId>
                        <version>2.0.0</version>
                        <extensions>true</extensions>
                        <dependencies>
                            <dependency>
                                <groupId>org.jboss</groupId>
                                <artifactId>jbossorg-docbook-xslt</artifactId>
                                <version>1.1.0</version>
                            </dependency>
                            <dependency>
                                <groupId>org.jboss</groupId>
                                <artifactId>jbossorg-jdocbook-style</artifactId>
                                <version>1.1.0</version>
                                <type>jdocbook-style</type>
                            </dependency>
                        </dependencies>
                        <executions>

                            <!-- The User Guide-->
                            <execution>
                                <id>userguide_en</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>resources</goal>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <sourceDocumentName>master.xml</sourceDocumentName>
                                    <sourceDirectory>${basedir}/src/main/docbook/userguide/en</sourceDirectory>
                                    <imageResource>
                                        <directory>${basedir}/src/main/docbook/images</directory>
                                    </imageResource>
                                    <cssResource>
                                        <directory>${basedir}/src/main/docbook/css</directory>
                                    </cssResource>
                                    <targetDirectory>${basedir}/target/docbook/userguide_en</targetDirectory>
                                    <formats>
                                        <format>
                                            <formatName>pdf</formatName>
                                            <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
                                            <finalName>userguide_en.pdf</finalName>
                                        </format>
                                        <format>
                                            <formatName>html</formatName>
                                            <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
                                            <finalName>index.html</finalName>
                                        </format>
                                        <format>
                                            <formatName>html_single</formatName>
                                            <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl
                                            </stylesheetResource>
                                            <finalName>index.html</finalName>
                                        </format>
                                    </formats>
                                    <options>
                                        <xincludeSupported>false</xincludeSupported>
                                    </options>
                                </configuration>
                            </execution>

                            <!-- The Tutorial -->
                            <execution>
                                <id>tutorial_en</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>resources</goal>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <sourceDocumentName>master.xml</sourceDocumentName>
                                    <sourceDirectory>${basedir}/src/main/docbook/tutorial/en</sourceDirectory>
                                    <imageResource>
                                        <directory>${basedir}/src/main/docbook/images</directory>
                                    </imageResource>
                                    <cssResource>
                                        <directory>${basedir}/src/main/docbook/css</directory>
                                    </cssResource>
                                    <targetDirectory>${basedir}/target/docbook/tutorial_en</targetDirectory>
                                    <formats>
                                        <format>
                                            <formatName>pdf</formatName>
                                            <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
                                            <finalName>tutorial_en.pdf</finalName>
                                        </format>
                                        <format>
                                            <formatName>html</formatName>
                                            <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
                                            <finalName>index.html</finalName>
                                        </format>
                                        <format>
                                            <formatName>html_single</formatName>
                                            <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl
                                            </stylesheetResource>
                                            <finalName>index.html</finalName>
                                        </format>
                                    </formats>
                                    <options>
                                        <xincludeSupported>false</xincludeSupported>
                                    </options>
                                </configuration>
                            </execution>

                            <!-- the FAQs -->
                            <execution>
                                <id>faq_en</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>resources</goal>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <sourceDocumentName>master.xml</sourceDocumentName>
                                    <sourceDirectory>${basedir}/src/main/docbook/faq/en</sourceDirectory>
                                    <imageResource>
                                        <directory>${basedir}/src/main/docbook/images</directory>
                                    </imageResource>
                                    <cssResource>
                                        <directory>${basedir}/src/main/docbook/css</directory>
                                    </cssResource>
                                    <targetDirectory>${basedir}/target/docbook/faq_en</targetDirectory>
                                    <formats>
                                        <format>
                                            <formatName>pdf</formatName>
                                            <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
                                            <finalName>faq_en.pdf</finalName>
                                        </format>
                                        <format>
                                            <formatName>html</formatName>
                                            <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
                                            <finalName>index.html</finalName>
                                        </format>
                                        <format>
                                            <formatName>html_single</formatName>
                                            <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl
                                            </stylesheetResource>
                                            <finalName>index.html</finalName>
                                        </format>
                                    </formats>
                                    <options>
                                        <xincludeSupported>false</xincludeSupported>
                                    </options>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>test-hudson</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <defaultTestGroup>functional,unit</defaultTestGroup>
                <protocol.stack>tcp</protocol.stack>
            </properties>
        </profile>

        <profile>
            <id>test-functional</id>
            <properties>
                <defaultTestGroup>functional</defaultTestGroup>
                <protocol.stack>tcp</protocol.stack>
            </properties>
        </profile>

        <profile>
            <id>test-unit</id>
            <properties>
                <defaultTestGroup>unit</defaultTestGroup>
            </properties>
        </profile>

        <profile>
            <id>test-jgroups</id>
            <properties>
                <defaultTestGroup>jgroups</defaultTestGroup>
            </properties>
        </profile>

        <profile>
            <id>test-transaction</id>
            <properties>
                <defaultTestGroup>transaction</defaultTestGroup>
            </properties>
        </profile>

        <profile>
            <id>profiling</id>
            <properties>
                <defaultTestGroup>profiling</defaultTestGroup>
            </properties>
        </profile>

        <profile>
            <id>test-integration</id>
            <properties>
                <defaultTestGroup>integration</defaultTestGroup>
                <protocol.stack>udp</protocol.stack>
            </properties>
        </profile>


        <profile>
            <id>JBossAS</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <jbosscache-core-version>3.2.0-SNAPSHOT-JBossAS</jbosscache-core-version>
                <defaultTestGroup>functional,unit</defaultTestGroup>
                <protocol.stack>tcp</protocol.stack>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>jgroups</groupId>
                    <artifactId>jgroups</artifactId>
                    <version>2.6.9.GA</version>
                </dependency>
                <!-- Replaces javax.transaction/jta -->
                <dependency>
                    <groupId>org.jboss.javaee</groupId>
                    <artifactId>jboss-javaee</artifactId>
                    <version>5.0.1.GA</version>
                </dependency>
                <dependency>
                    <groupId>org.jboss</groupId>
                    <artifactId>jboss-common-core</artifactId>
                    <version>2.2.14.GA</version>
                </dependency>
                <dependency>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                    <version>1.1.0.jboss</version>
                </dependency>
                <dependency>
                    <groupId>jboss.jbossts</groupId>
                    <artifactId>jbossjta</artifactId>
                    <version>4.4.0.GA</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>
