<?xml version="1.0" encoding="UTF-8" ?>

<!--
  - Author: anshul@marketcetera.com
  - Since: 1.0.0
  - Version: $Id$
  - $License$
  -->

<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>org.marketcetera</groupId>
      <artifactId>public-parent</artifactId>
      <version>3.2.1</version>
  </parent>
  <artifactId>client</artifactId>
  <packaging>jar</packaging>

  <name>Client Libraries</name>

  <dependencies>

    <!-- Compile. -->
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>core</artifactId>
    </dependency>
    <!-- Runtime. -->
    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-pool</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-broker</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-stomp</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-jaas</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-pool</groupId>
      <artifactId>commons-pool</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-jta_1.1_spec</artifactId>
    </dependency>
    <!-- Ensures that older versions are not used by other dependencies. -->
    <dependency>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
      <scope>runtime</scope>
    </dependency>

    <!-- Testing. -->
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-transports-http-jetty</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.xbean</groupId>
      <artifactId>xbean-spring</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>core</artifactId>
      <type>test-jar</type>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>util-test</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
    </dependency> 
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!-- override configuration to fork 1 at a time -->
      <plugin>
	<artifactId>maven-surefire-plugin</artifactId>
	<configuration>
	  <disableXmlReport>false</disableXmlReport>
	  <forkCount>1</forkCount>
	  <reuseForks>false</reuseForks>
	  <argLine>${mvn.test.options}</argLine>
	  <systemPropertyVariables>
	    <org.marketcetera.appDir>src/test/sample_data</org.marketcetera.appDir>
	  </systemPropertyVariables>
	</configuration>
      </plugin>
      <!-- Place tests into a jar for use during testing of other packages. -->
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Configure Eclipse IDE metadata. -->
      <plugin>
        <artifactId>maven-eclipse-plugin</artifactId>
        <configuration>
          <pde>true</pde>
          <manifest>null</manifest>
          <resolveDependencies>false</resolveDependencies>
        </configuration>
      </plugin>
      <!-- bundle all dependencies for ease of externalization -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-dependencies</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/output</outputDirectory>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>false</overWriteSnapshots>
              <overWriteIfNewer>true</overWriteIfNewer>
	      <includeScope>runtime</includeScope>
            </configuration>
          </execution>
        </executions>
      </plugin>     
    </plugins>
  </build>
  
  <profiles>
    <!-- Execute mock server -->
    <profile>
      <id>mockServer</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <configuration>
              <mainClass>org.marketcetera.client.MockServer</mainClass>
              <arguments>
                <argument>src/test/sample_data/inputs/equity.txt</argument>
              </arguments>
              <classpathScope>test</classpathScope>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <!-- Generate XML Schema -->
    <profile>
      <id>schemaGen</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <configuration>
              <mainClass>org.marketcetera.client.jms.SchemaGen</mainClass>
              <classpathScope>test</classpathScope>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
