<?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-pojo-version>2.1.0.CR3</jbosscache-pojo-version>
    <jbosscache-core-version>2.1.0.CR3</jbosscache-core-version>
    <jboss.aop.version>2.0.0.CR3</jboss.aop.version>
  </properties>
  <parent>
    <groupId>org.jboss.cache</groupId>
    <artifactId>jbosscache-common-parent</artifactId>
    <version>1.1</version>
  </parent>
  <groupId>org.jboss.cache</groupId>
  <artifactId>jbosscache-pojo</artifactId>
  <version>${jbosscache-pojo-version}</version>
  <name>JBoss Cache - POJO Edition</name>
  <description>JBoss Cache - POJO Edition</description>
  <packaging>jar</packaging>
  <dependencies>
    <dependency>
      <groupId>org.jboss.aop</groupId>
      <artifactId>jboss-aop</artifactId>
      <version>${jboss.aop.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jboss.cache</groupId>
      <artifactId>jbosscache-core</artifactId>
      <version>${jbosscache-core-version}</version>
    </dependency>
    <dependency>
      <groupId>org.jboss.cache</groupId>
      <artifactId>jbosscache-core</artifactId>
      <version>${jbosscache-core-version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <!-- Hack AOP has broken deps -->
    <dependency>
      <groupId>org.jboss.microcontainer</groupId>
      <artifactId>jboss-container</artifactId>
      <version>2.0.0.Beta4</version>
      <scope>runtime</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
    <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>
              </descriptors>
              <finalName>${artifactId}-${jbosscache-pojo-version}</finalName>
              <outputDirectory>target/distribution</outputDirectory>
              <workDirectory>target/assembly/work</workDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.3</version>
        <configuration>
          <systemProperties>
            <property>
              <name>bind.address</name>
              <value>127.0.0.1</value>
            </property>
            <property>
              <name>java.net.preferIPv4Stack</name>
              <value>true</value>
            </property>
            <property>
              <name>jgroups.stack</name>
              <value>udp</value>
            </property>
          </systemProperties>
          <groups>functional</groups>
          <forkMode>always</forkMode>
          <argLine>-Djboss.aop.path=${basedir}/src/main/resources/META-INF/pojocache-aop.xml -javaagent:${settings.localRepository}/org/jboss/aop/jboss-aop/${jboss.aop.version}/jboss-aop-${jboss.aop.version}.jar</argLine>
          <!-- Warning, this does not work right on 2.4-SNAPSHOT, (see SUREFIRE-349) -->
          <!-- This seems to fail in some cases on 2.3 as well, disable for now -->
          <useSystemClassLoader>true</useSystemClassLoader>
          <redirectTestOutputToFile>false</redirectTestOutputToFile>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jboss.maven.plugins</groupId>
        <artifactId>maven-jbossaop-plugin</artifactId>
        <version>2.0.0.beta1</version>
        <!-- HACK: AOP project and plugin has broken deps -->
        <dependencies>    
          <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.0.4</version>
          </dependency>
          <dependency>
            <groupId>org.jboss.cache</groupId>
            <artifactId>jbosscache-core</artifactId>
            <version>${jbosscache-core-version}</version>
          </dependency>
          <dependency>
            <groupId>org.jboss.aop</groupId>
            <artifactId>jboss-aop</artifactId>
            <version>${jboss.aop.version}</version>
          </dependency>
        </dependencies> 
        <executions>
          <execution>
            <id>aopc</id>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <verbose>false</verbose>
              <aoppaths>
              <aoppath>${basedir}/src/main/resources/META-INF/pojocache-aop.xml</aoppath>
              </aoppaths>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- 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.cache</groupId>
            <artifactId>jbosscache-doc-xslt-support</artifactId>
            <version>1.0</version>
          </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:/standard/fopdf.xsl</stylesheetResource>
                  <finalName>userguide_en.pdf</finalName>
                </format>
                <format>
                  <formatName>html</formatName>
                  <stylesheetResource>classpath:/standard/html_chunk.xsl</stylesheetResource>
                  <finalName>index.html</finalName>
                </format>
                <format>
                  <formatName>html_single</formatName>
                  <stylesheetResource>classpath:/standard/html.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:/standard/fopdf.xsl</stylesheetResource>
                  <finalName>tutorial_en.pdf</finalName>
                </format>
                <format>
                  <formatName>html</formatName>
                  <stylesheetResource>classpath:/standard/html_chunk.xsl</stylesheetResource>
                  <finalName>index.html</finalName>
                </format>
                <format>
                  <formatName>html_single</formatName>
                  <stylesheetResource>classpath:/standard/html.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:/standard/fopdf.xsl</stylesheetResource>
                  <finalName>faq_en.pdf</finalName>
                </format>
                <format>
                  <formatName>html</formatName>
                  <stylesheetResource>classpath:/standard/html_chunk.xsl</stylesheetResource>
                  <finalName>index.html</finalName>
                </format>
                <format>
                  <formatName>html_single</formatName>
                  <stylesheetResource>classpath:/standard/html.xsl</stylesheetResource>
                  <finalName>index.html</finalName>
                </format>
              </formats>
              <options>
                <xincludeSupported>false</xincludeSupported>
              </options>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <!-- 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>
  </repositories>
</project>
