<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">
  <parent>
    <groupId>org.jboss</groupId>
    <artifactId>jboss-parent</artifactId>
    <version>5</version>
  </parent>
  
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.jboss.native</groupId>
  <artifactId>mod-cluster</artifactId>
  <version>1.0.10.GA_CP04</version>
  
  <name>mod_cluster</name>
  <description />
  <url>http://jboss.org/mod_cluster</url>
  
  <scm>
    <connection>scm:git:https://github.com/modcluster/mod_cluster.git</connection>
    <developerConnection>scm:git:https://github.com/modcluster/mod_cluster.git</developerConnection>
    <url>https://github.com/modcluster/mod_cluster</url>
    <tag>MOD_CLUSTER_1_0_10_GA_CP04</tag>
  </scm>

  <repositories>
    <repository>
      <id>repository.jboss.org</id>
      <name>JBoss Public Repository</name>
      <url>http://repository.jboss.org/nexus/content/groups/public/</url>
    </repository>
    <repository>
      <id>old.jboss.org</id>
      <name>JBoss Public Repository</name>
      <url>http://repository.jboss.org/maven2/</url>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>org.jboss.cluster</groupId>
      <artifactId>jboss-ha-server-api</artifactId>
      <version>1.1.1.GA</version>
    </dependency>
    <dependency>
      <groupId>jboss.web</groupId>
      <artifactId>jbossweb</artifactId>
      <version>2.1.3.GA</version>
    </dependency>
    <dependency>
      <groupId>net.jcip</groupId>
      <artifactId>jcip-annotations</artifactId>
      <version>1.0</version>
    </dependency>
    <dependency>
      <groupId>org.jboss.microcontainer</groupId>
      <artifactId>jboss-kernel</artifactId>
      <version>2.0.6.GA</version>
    </dependency>

    <!--  For installation in standalone JBoss Web or Tomcat -->
    <dependency>
      <groupId>org.jboss.logging</groupId>
      <artifactId>jboss-logging-jdk</artifactId>
      <version>2.1.0.GA</version>
      <optional>true</optional>
    </dependency>
    
    <!-- Test dependencies -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.4</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
      <version>2.4</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.test</groupId>
      <artifactId>jboss-test</artifactId>
      <version>1.1.5-alpha-2</version>
      <scope>test</scope>
    </dependency>
    <!-- jboss-as-server is optional dependency within jboss-server-manager, which is transitive dependency of jboss-test -->
    <dependency>
      <groupId>org.jboss.jbossas</groupId>
      <artifactId>jboss-as-server</artifactId>
      <version>5.1.0.GA</version>
      <scope>test</scope>
    </dependency>
    
    <!-- Demo dependencies -->
    <!-- Use provided scope, until demo is moved to separate module -->
    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <version>1.3</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>commons-httpclient</groupId>
      <artifactId>commons-httpclient</artifactId>
      <version>3.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jfree</groupId>
      <artifactId>jfreechart</artifactId>
      <version>1.0.9</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jfree</groupId>
      <artifactId>jcommon</artifactId>
      <version>1.0.12</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  
  <build>
    <resources>
      <resource>
        <directory>src/main/java</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
    </resources>
    <plugins>
      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <configuration>
            <source>1.5</source>
         </configuration>
      </plugin>

  <plugin>
    <artifactId>maven-release-plugin</artifactId>
    <version>2.3.2</version>
  </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <printSummary>true</printSummary>
          <disableXmlReport>false</disableXmlReport>
          <includes>
            <include>**/*TestCase.java</include>
          </includes>
          <!-- Integration tests are in the "test" package; don't
               run those during the normal surefire run -->
          <excludes>
            <exclude>**/test/**/*.java</exclude>
          </excludes>
          <systemProperties>
            <property>
              <name>java.net.preferIPv4Stack</name>
              <value>true</value>
            </property>
          </systemProperties>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>sar</id>
            <goals>
              <goal>directory-inline</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <finalName>${project.artifactId}.sar</finalName>
              <appendAssemblyId>false</appendAssemblyId>
              <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
              <descriptors>
                <descriptor>src/assembly/sar.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>1.3</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  
  <profiles>
    <profile>
      <id>integration-test</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <!-- Unpack requisite build scripts -->
              <execution>
                <id>unpack-build-scripts</id>
                <phase>process-resources</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.jboss.test</groupId>
                      <artifactId>jboss-test</artifactId>
                    </artifactItem>
                  </artifactItems>
                  <outputDirectory>${project.build.directory}/dependencies/unpacked/jboss-test</outputDirectory>
                  <overWriteIfNewer>true</overWriteIfNewer>
                </configuration>
              </execution>
              <!--  Copy jboss-test JAR -->
              <execution>
                <id>copy-jboss-test</id>
                <phase>process-resources</phase>
                <goals>
                  <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.jboss.test</groupId>
                      <artifactId>jboss-test</artifactId>
                    </artifactItem>
                  </artifactItems>
                  <outputDirectory>${project.build.directory}/dependencies/lib</outputDirectory>
                  <overWriteIfNewer>true</overWriteIfNewer>
                  <stripVersion>true</stripVersion>
                  <excludeTransitive>false</excludeTransitive>
                </configuration>
              </execution>
            </executions>
          </plugin>
      
          <!-- The individual integration tests are built and run using Ant -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>build-tests</id>
                <goals>
                  <goal>run</goal>
                </goals>
                <phase>integration-test</phase>
                <configuration>
                  <tasks>
                  
                    <!-- Execute the Test Build -->
                    <ant antfile="build-test.xml" target="main" />
                    
                    <ant antfile="build-test.xml" target="tests-apache-integration" />
                    
                    <!-- Execute the integration tests that require httpd -->
                    <!--ant antfile="build-test.xml" target="tests-clustering-unit" /-->
                    
                  </tasks>
                </configuration>
              </execution>
            </executions>
            <!-- maven-antrun-plugin does not include optional jars by default -->
            <dependencies>
              <dependency>
                <groupId>org.apache.ant</groupId>
                <artifactId>ant-junit</artifactId>
                <version>1.7.0</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>dist</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>copy-core-dependencies</id>
                <phase>process-resources</phase>
                <goals>
                  <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.jboss.native</groupId>
                      <artifactId>mod-cluster</artifactId>
                    </artifactItem>
                  </artifactItems>
                  <outputDirectory>${project.build.directory}/dependencies/lib</outputDirectory>
                  <overWriteIfNewer>true</overWriteIfNewer>
                  <stripVersion>true</stripVersion>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>build-demo</id>
                <goals>
                  <goal>run</goal>
                </goals>
                <phase>package</phase>
                <configuration>
                  <tasks>
              
                    <!-- Execute the Test Build -->
                    <ant antfile="build-demo.xml" target="main" />
              
                    <!-- Create the JBossWeb-Tomcat install structure -->
                    <ant antfile="build-jbossweb.xml" target="all">
                       <property name="mod-cluster.jar.name" value="${project.build.finalName}" />
                    </ant>
                
                    <!-- Execute the demo that require httpd -->
                    <!--ant antfile="build-demo.xml" target="run-demo" /-->
                
                  </tasks>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <inherited>false</inherited>
            <executions>
              <execution>
                <id>bin</id>
                <goals>
                  <goal>attached</goal>
                </goals>
                <phase>package</phase>
                <configuration>
                  <descriptors>
                    <descriptor>src/assembly/bin.xml</descriptor>
                  </descriptors>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
