<?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.0.0.CR4</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.4</version>
   </parent>
   <groupId>org.jboss.cache</groupId>
   <artifactId>jbosscache-core</artifactId>
   <version>${jbosscache-core-version}</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.6.5.GA</version>
      </dependency>

      <!-- For the JTA 1.1 API; consuming projects can safely
           exclude this and replace with any valid source of this API -->
      <dependency>
         <groupId>javax.transaction</groupId>
         <artifactId>jta</artifactId>
         <version>1.1</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.8.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.1</version>
         <optional>true</optional>
      </dependency>
      <dependency>
         <groupId>sleepycat</groupId>
         <artifactId>je</artifactId>
         <version>3.2.43</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>org.easymock</groupId>
         <artifactId>easymock</artifactId>
         <version>2.3</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>jboss.jbossts</groupId>
         <artifactId>jbossjta</artifactId>
         <version>4.3.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.3</version>
         <scope>test</scope>
      </dependency>
      <!-- 5.8 is needed for propper 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>methods</parallel>
               <threadCount>10</threadCount>
               <forkMode>none</forkMode>
               	<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>
   </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>
         <properties>
            <defaultTestGroup>functional,unit</defaultTestGroup>
         </properties>
      </profile>

      <profile>
         <id>test-functional</id>
         <properties>
            <defaultTestGroup>functional</defaultTestGroup>
         </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>
                                             </properties>
                                                   </profile>


      <profile>
         <id>JBossAS</id>
         <activation>
            <activeByDefault>false</activeByDefault>
         </activation>
         <properties>
            <jbosscache-core-version>3.0.0.CR3-JBossAS</jbosscache-core-version>
         </properties>
         <dependencies>
            <dependency>
               <groupId>jgroups</groupId>
               <artifactId>jgroups</artifactId>
               <version>2.6.5.GA</version>
            </dependency>
            <!-- Replaces javax.transaction/jta -->
            <dependency>
               <groupId>org.jboss.javaee</groupId>
               <artifactId>jboss-javaee</artifactId>
               <version>5.0.0.CR1</version>
            </dependency>
            <dependency>
               <groupId>org.jboss</groupId>
               <artifactId>jboss-common-core</artifactId>
               <version>2.2.8.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.3.0.GA</version>
               <scope>test</scope>
            </dependency>
         </dependencies>
      </profile>
   </profiles>
</project>
