<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>
  <groupId>org.springframework.samples.petclinic</groupId>
  <artifactId>petclinic</artifactId>
  <packaging>war</packaging>
  <version>1.0-SNAPSHOT</version>

  <build>
    <sourceDirectory>src</sourceDirectory>
    <resources>
      <resource>
        <directory>src</directory>
      </resource>
    </resources>

    <testSourceDirectory>test</testSourceDirectory>
    <testResources>
      <testResource>
        <directory>test</directory>
      </testResource>
    </testResources>

    <plugins>

      <!--
      <plugin>
        <groupId>org.codehaus.enunciate</groupId>
        <artifactId>maven-enunciate-plugin</artifactId>
        <version>1.8.1</version>
        <executions>
          <execution>
            <goals>
              <goal>assemble</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      -->

      <plugin>
        <!--we have to configure the war plugin to look at the right source root-->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.0</version>
        <configuration>
          <warSourceDirectory>war</warSourceDirectory>
        </configuration>
      </plugin>

      <plugin>
        <!--the plugin that starts HSQLDB-->
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.1</version>
        <configuration>
          <mainClass>org.hsqldb.Server</mainClass>
          <!-- optional -->
          <workingDirectory>${project.build.directory}</workingDirectory>
          <arguments>
            <argument>-database</argument>
            <argument>petclinic</argument>
          </arguments>
        </configuration>
      </plugin>

      <plugin>
        <!--make sure we're compiling for 1.5-->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>

      <plugin>
        <!--prime the db-->
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>sql-maven-plugin</artifactId>
        <version>1.2</version>

        <dependencies>
          <dependency>
            <groupId>hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>1.8.0.7</version>
          </dependency>
        </dependencies>

        <configuration>
          <driver>org.hsqldb.jdbcDriver</driver>
          <url>jdbc:hsqldb:hsql://localhost:9001</url>
          <username>sa</username>
          <password></password>

          <autocommit>true</autocommit>
          <sqlCommand>
            DROP TABLE IF EXISTS visits;
            DROP TABLE IF EXISTS pets;
            DROP TABLE IF EXISTS owners;
            DROP TABLE IF EXISTS types;
            DROP TABLE IF EXISTS vet_specialties;
            DROP TABLE IF EXISTS specialties;
            DROP TABLE IF EXISTS vets;
          </sqlCommand>
          <srcFiles>
            <srcFile>db/hsqldb/initDB.txt</srcFile>
            <srcFile>db/populateDB.txt</srcFile>
          </srcFiles>
        </configuration>
      </plugin>

      <plugin>
        <!--start an app server-->
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId>
        <configuration>
          <systemProperties>
            <systemProperty>
              <name>petclinic.root</name>
              <value>${project.build.directory}/${project.build.finalName}</value>
            </systemProperty>
          </systemProperties>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>aspectj</groupId>
      <artifactId>aspectjrt</artifactId>
      <version>1.5.4</version>
    </dependency>

    <dependency>
      <groupId>aspectj</groupId>
      <artifactId>aspectjweaver</artifactId>
      <version>1.5.4</version>
    </dependency>

    <dependency>
      <groupId>cglib</groupId>
      <artifactId>cglib-nodep</artifactId>
      <version>2.1_3</version>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.3</version>
    </dependency>

    <dependency>
      <groupId>commons-dbcp</groupId>
      <artifactId>commons-dbcp</artifactId>
      <version>1.2.2</version>
    </dependency>

    <dependency>
      <groupId>javax.persistence</groupId>
      <artifactId>toplink-essentials</artifactId>
      <version>1.0</version>
    </dependency>

    <dependency>
      <groupId>hsqldb</groupId>
      <artifactId>hsqldb</artifactId>
      <version>1.8.0.7</version>
    </dependency>

    <dependency>
      <groupId>org.codehaus.enunciate</groupId>
      <artifactId>enunciate-rt</artifactId>
      <version>1.8.1</version>
    </dependency>

    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-core</artifactId>
      <version>3.3.0.SP1</version>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring</artifactId>
      <version>2.5.4</version>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
      <version>2.5.4</version>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-test</artifactId>
      <version>2.5.4</version>

      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.5</version>

      <scope>test</scope>
    </dependency>

  </dependencies>
</project>
