<?xml version="1.0" encoding="UTF-8"?>

<!--.......-->

<build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.0</version>
        <configuration>
          <source>1.3</source>
          <target>1.3</target>
        </configuration>
      </plugin>
      <!--ant run plugin for creating distributions-->
      <plugin>
        <inherited>false</inherited>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
           <executions>
             <execution>
               <id>dst</id>
               <phase>install</phase>
               <configuration>
                 <tasks>
                    <echo>Creating Distributions</echo>
                    <ant dir="./util" antfile="build_dist_mvn.xml"/>
                 </tasks>
               </configuration>
               <goals>
                 <goal>run</goal>
               </goals>
             </execution>
           </executions>
      </plugin>
     </plugins>
     <pluginManagement>
       <plugins>
        <plugin>
            <!--ant run plugin for rmic and copying jars-->
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-antrun-plugin</artifactId>
           <executions>
             <execution>
               <id>rmic</id>
               <phase>process-classes</phase>
               <configuration>
                <tasks>
                  <echo>Running rmic</echo>
                  <rmic base="${project.build.directory}/classes"  verify="true">
                  <classpath refid="maven.compile.classpath" />
                  </rmic>
                </tasks>
              </configuration>
              <goals>
                <goal>run</goal>
              </goals>
             </execution>
             <execution>
               <id>cp</id>
               <phase>package</phase>
               <configuration>
                <tasks>
                  <echo>Copying jar to build directory</echo>
                  <copy file="target/${artifactId}-${version}.jar" tofile="../build/${artifactId}.jar"/>
                  <copy file="target/${artifactId}-${version}.jar" tofile="../src/site/resources/jars/${artifactId}-${version}.jar"/>
                </tasks>
              </configuration>
              <goals>
                <goal>run</goal>
              </goals>
             </execution>
           </executions>
           <dependencies>
             <dependency>
               <groupId>com.sun</groupId>
               <artifactId>tools</artifactId>
               <scope>system</scope>
               <version>1.3</version>
               <systemPath>${java.home}/../lib/tools.jar</systemPath>
             </dependency>
           </dependencies>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

<!--.......-->
