<?xml version="1.0"?>
<!--

$Id$

Copyright (c) 2008-2011, The University of Edinburgh
All Rights Reserved

-->
<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>
  <name>SnuggleTeX Web Application</name>
  <artifactId>snuggletex-webapp</artifactId>
  <packaging>war</packaging>
  <parent>
    <groupId>de.rototor.snuggletex</groupId>
    <artifactId>snuggletex</artifactId>
    <version>1.5.0-SNAPSHOT</version>
  </parent>
  <properties>
    <context.path>/snuggletex</context.path>
  </properties>
  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>snuggletex-core</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>snuggletex-jeuclid</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>snuggletex-upconversion</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>${slf4j.version}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>${log4j.version}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.4</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <!-- Dynamically Generated Resources -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <!-- Generate snuggletex.css -->
          <execution>
            <id>snuggletex.css</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>java</executable>
              <classpathScope>runtime</classpathScope>
              <arguments>
                <argument>-classpath</argument>
                <classpath />
                <argument>uk.ac.ed.ph.snuggletex.utilities.CSSUtilities</argument>
                <argument>${project.build.directory}/extras/includes/snuggletex.css</argument>
              </arguments>
            </configuration>
          </execution>
          <!-- Create Error Codes documentation page source -->
          <execution>
            <id>generate-error-codes-page</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>java</executable>
              <classpathScope>runtime</classpathScope>
              <arguments>
                <argument>-classpath</argument>
                <classpath />
                <argument>uk.ac.ed.ph.snuggletex.webapp.ErrorCodeDocumentBuilder</argument>
                <argument>${project.build.directory}/extras/WEB-INF/docs/error-codes.tex</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- Pull in extra content created above when building WAR structure -->
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <warName>snuggletex</warName>
          <webResources>
            <resource>
              <directory>${project.build.directory}/extras</directory>
            </resource>
          </webResources>
          <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
