<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>
    <artifactId>alchemy-ii-trader</artifactId>
    <groupId>alchemy</groupId>
    <version>4.1.0-SNAPSHOT</version>
  </parent>

  <artifactId>alchemy-eclipse</artifactId>
  <packaging>jar</packaging>
  <name>Alchemy Eclipse</name>
  <url>https://alchemy.scmb.co.za/docs/trader/trunk/alchemy-eclipse/</url>

  <build>
    <sourceDirectory>src</sourceDirectory>
<!--    <testSourceDirectory>src</testSourceDirectory>-->
    <resources>
      <resource>
        <directory>${basedir}</directory>
        <includes>
          <include>plugin.xml</include>
          <include>plugin.properties</include>
        </includes>
        <targetPath>/</targetPath>
      </resource>
      <resource>
        <directory>src</directory>
        <includes>
          <include>*/.xml</include>
        </includes>
      </resource>
      <resource>
        <directory>src</directory>
        <includes>
          <include>*/.properties</include>
        </includes>
      </resource>
    </resources>
    <plugins>

      <!-- tell the eclipse plugin this is a PDE project -->
      <plugin>
        <artifactId>maven-eclipse-plugin</artifactId>
        <configuration>
          <classpathContainers>
            <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
            <classpathContainer>SWT_CONTAINER/PLATFORM</classpathContainer>
          </classpathContainers>
<!-- 
          <projectnatures>
            <projectnature>org.eclipse.jdt.core.javanature</projectnature>
          </projectnatures>
-->
          <pde>true</pde>
        </configuration>
      </plugin>

      <!-- copy dependencies into the local build tree, as
           required by PDE -->
<!-- 
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-dependencies</id>
            <phase>process-sources</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/lib</outputDirectory>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>false</overWriteSnapshots>
              <overWriteIfNewer>true</overWriteIfNewer>
            </configuration>
          </execution>
        </executions>
      </plugin>
-->

      <!-- plugin to build this as an eclipse rcp package -->
<!--
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>pde-maven-plugin</artifactId>
        <version>1.0-alpha-1-SNAPSHOT</version>
        <extensions>true</extensions>
        <configuration>
          <eclipseInstall>${eclipse.home}</eclipseInstall>
          <pdeProductFilename>alchemy-eclipse.product</pdeProductFilename>
          <pdeBuildVersion>3.2.1.r321_v20060823</pdeBuildVersion>          
        </configuration>
      </plugin>
-->

      <!-- =============================================================  -->
      <!--  Test the PDE Plugin: Yusuf -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>pde-maven-plugin</artifactId>
        <version>1.0-alpha-1-SNAPSHOT</version>
        <extensions>true</extensions>
        <configuration>
          <!--<eclipseInstall>C:\eclipse\eclipse-3-2-2\eclipse</eclipseInstall>-->
          <pdeProductFilename>alchemy-eclipse.product</pdeProductFilename>
          <pdeBuildVersion>3.2.1.r321_v20060823</pdeBuildVersion>
          <pdeBuildConfigDirectory>/</pdeBuildConfigDirectory>          
          <antVerbose>true</antVerbose>
          <antDebug>true</antDebug>
          <!-- javacFailOnError>true</javacFailOnError-->
<properties>
  <property>
    <name>pom.version</name>
    <value>${pom.version}</value>
  </property>
  <property>
    <name>maven.dependency.classpath</name>
    <value>${maven.dependency.classpath}</value>
  </property>
</properties>
        </configuration>
        <!-- ======================================= -->
        <!--  New stuff added -->
        <executions>
        	<!--  Build with default Maven cycle using below -->
          <!-- execution>
            <id>build-pde</id>
            <phase>compile</phase>
            <goals>
              <goal>attach</goal>
            </goals>
          </execution -->
          <!-- Also bind to mvn clean -->
          <execution>
            <id>clean-pde</id>
            <phase>clean</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>          
        </executions>
        <!-- ======================================= -->
      </plugin>
      <!-- =============================================================  -->

      <!-- control unit tests -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <includes>
            <include>Sample.java</include>
          </includes>
          <excludes>
            <exclude>**/TestCircle.java</exclude>
            <exclude>**/TestSquare.java</exclude>
          </excludes>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <dependencies>

    <dependency>
      <groupId>alchemy</groupId>
      <artifactId>alchemy-trader</artifactId>
      <version>${pom.version}</version>
      <type>ejb</type>
    </dependency>

    <!--  All eclipse jars are marked as provided -->
    <dependency>
      <groupId>org.eclipse.jface</groupId>
      <artifactId>org.eclipse.jface</artifactId>
      <version>3.2.1</version>
      <scope>provided</scope>
    </dependency>
<!-- 
    <dependency>
      <groupId>org.eclipse.swt</groupId>
      <artifactId>org.eclipse.swt.win32.win32.x86</artifactId>
      <version>3.2.2</version>
      <scope>provided</scope>
    </dependency>
-->
    <dependency>
      <groupId>org.eclipse.ui</groupId>
      <artifactId>org.eclipse.ui.forms</artifactId>
      <version>3.2.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.ui</groupId>
      <artifactId>org.eclipse.ui.editors</artifactId>
      <version>3.2.1</version>
      <scope>provided</scope>
    </dependency>

  </dependencies>

  <reporting>
    <plugins>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jxr-maven-plugin</artifactId>
      </plugin>      
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-clover-plugin</artifactId>
      </plugin>
      <plugin>
         <groupId>org.apache.maven.plugins</groupId>

         <artifactId>maven-pmd-plugin</artifactId>
         <configuration>
            <targetjdk>1.5</targetjdk>
            <rulesets>
               <ruleset>/rulesets/basic.xml</ruleset>
               <ruleset>/rulesets/controversial.xml</ruleset>
            </rulesets>
            <format>xml</format>
            <linkXref>true</linkXref>
            <sourceEncoding>utf-8</sourceEncoding>

            <minimumTokens>100</minimumTokens>
         </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>changes-maven-plugin</artifactId>
      </plugin>
<!--
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>changelog-maven-plugin</artifactId>
      </plugin>
-->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>taglist-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </reporting>

</project>


