<?xml version='1.0' encoding='UTF-8'?>
<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.apache.continuum</groupId>
    <artifactId>continuum-flex</artifactId>
    <version>1.2-SNAPSHOT</version>
  </parent>
  <artifactId>continuum-flex-webapp</artifactId>
  <packaging>war</packaging>
  <name>Continuum Flex Webapp</name>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>continuum-flex-config</artifactId>
      <version>${project.version}</version>
      <classifier>resources</classifier>
      <type>zip</type>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>continuum-flex-ui</artifactId>
      <version>${project.version}</version>
      <type>swf</type>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>continuum-flex-plugin</artifactId>
      <version>${project.version}</version>
      <type>swf</type>
    </dependency>
    <dependency>
      <groupId>backport-util-concurrent</groupId>
      <artifactId>backport-util-concurrent</artifactId>
      <version>3.1</version>
    </dependency>
    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <version>1.3</version>
    </dependency>
    <dependency>
      <groupId>commons-httpclient</groupId>
      <artifactId>commons-httpclient</artifactId>
      <version>3.0.1</version>
    </dependency>
    <dependency>
      <groupId>concurrent</groupId>
      <artifactId>concurrent</artifactId>
      <version>1.3.3</version>
    </dependency>
    <dependency>
      <groupId>org.apache.continuum</groupId>
      <artifactId>continuum-xmlrpc-client</artifactId>
      <version>1.2-SNAPSHOT</version>
    </dependency>
    <dependency>
      <groupId>com.adobe.blazeds</groupId>
      <artifactId>flex-messaging-common</artifactId>
      <version>${blazeds.version}</version>
    </dependency>
    <dependency>
      <groupId>com.adobe.blazeds</groupId>
      <artifactId>flex-messaging-core</artifactId>
      <version>${blazeds.version}</version>
    </dependency>
    <dependency>
      <groupId>com.adobe.blazeds</groupId>
      <artifactId>flex-messaging-remoting</artifactId>
      <version>${blazeds.version}</version>
    </dependency>
    <dependency>
      <groupId>com.adobe.blazeds</groupId>
      <artifactId>flex-messaging-opt</artifactId>
      <version>${blazeds.version}</version>
    </dependency>
    <dependency>
      <groupId>com.adobe.blazeds</groupId>
      <artifactId>flex-messaging-proxy</artifactId>
      <version>${blazeds.version}</version>
    </dependency>
  </dependencies>

  <properties>
    <blazeds.version>3.0.0.544</blazeds.version>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>info.rvin.mojo</groupId>
        <artifactId>flex-compiler-mojo</artifactId>
        <version>1.0</version>
        <extensions>true</extensions>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-swf</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
              <includeTypes>swf</includeTypes>
            </configuration>
          </execution>
          <execution>
            <id>unpack-config</id>
            <goals>
              <goal>unpack-dependencies</goal>
            </goals>
            <phase>generate-resources</phase>
            <configuration>
              <outputDirectory>src/main/webapp/WEB-INF/flex</outputDirectory>
              <includeArtifacIds>continuum-flex-config</includeArtifacIds>
              <includeGroupIds>${project.groupId}</includeGroupIds>
              <includeClassifiers>resources</includeClassifiers>
              <excludeTransitive>true</excludeTransitive>
              <excludeTypes>jar,swf,swc</excludeTypes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.1</version>
        <executions>
          <execution>
            <id>rename-swf</id>
            <phase>process-classes</phase>
            <configuration>
              <tasks>
                <move file="${project.build.directory}/${project.build.finalName}/continuum-flex-ui-${project.version}.swf"
                      tofile="src/main/webapp/index.swf"/>
                <move file="${project.build.directory}/${project.build.finalName}/continuum-flex-plugin-${project.version}.swf"
                      tofile="src/main/webapp/plugin1.swf"/>
                </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.1.1</version>
        <configuration>
          <filesets>
            <fileset>
              <directory>${basedir}/src/main/webapp</directory>
              <includes>
                <include>index.swf</include>
                <include>plugin1.swf</include>
                <include>WEB-INF/flex/remoting-config.xml</include>
                <include>WEB-INF/flex/services-config.xml</include>
              </includes>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.0.2</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId>
        <version>6.1.11</version>
        <configuration>
          <scanIntervalSeconds>10</scanIntervalSeconds>
          <contextPath>/continuum-flex-webapp</contextPath>
          <connectors>
            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
              <port>9090</port>
              <maxIdleTime>60000</maxIdleTime>
            </connector>
          </connectors>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <repositories>
    <repository>
      <!-- This repository contains blazeds artifacts -->
      <id>fna-repository</id>
      <name>fna-repository</name>
      <url>http://fna.googlecode.com/svn/trunk/fna/fna_m2_repository/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>flex-mojos-repository</id>
      <url>http://svn.sonatype.org/flexmojos/repository/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>flex-mojos-repository</id>
      <url>http://svn.sonatype.org/flexmojos/repository/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>
</project>
