<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.dojotoolkit</groupId>
      <artifactId>dojo-maven</artifactId>
      <version>1.3.0</version>
      <relativePath>../pom.xml</relativePath>
  </parent>
  <groupId>org.dojotoolkit</groupId>
  <artifactId>dojo-war</artifactId>
  <packaging>war</packaging>
  <name>Dojo Toolkit :: WAR</name>
  <properties>
    <jetty.version>6.1.14</jetty.version>
  </properties>
  <build>
    <defaultGoal>install</defaultGoal>
    <plugins>
      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <configuration>
            <webXml>${basedir}/src/main/webapp/WEB-INF/web.xml</webXml>
            <warSourceDirectory>${project.build.directory}/dojo-release-${dojo.version}</warSourceDirectory>
          </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>wagon-maven-plugin</artifactId>
        <version>1.0-beta-1</version>
        <executions>
          <execution>
            <id>download-dojo</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>download-single</goal>
            </goals>
            <configuration>
              <serverId>dojotoolkit</serverId>
              <url>http://download.dojotoolkit.org/release-${dojo.version}</url>
              <fromFile>dojo-release-${dojo.version}.tar.gz</fromFile>
              <toDir>${project.build.directory}</toDir>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack</id>
            <configuration>
              <tasks>      
                <untar compression="gzip" src="${project.build.directory}/dojo-release-${dojo.version}.tar.gz" dest="${project.build.directory}" />
              </tasks>
            </configuration>
            <phase>process-resources</phase>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId>
        <version>${jetty.version}</version>
        <configuration>
          <scanIntervalSeconds>0</scanIntervalSeconds>
          <webAppConfig>
            <contextPath>/dojo</contextPath>
          </webAppConfig>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
</project>
