<?xml version="1.0"?>
<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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.googlecode.libphonenumber</groupId>
  <artifactId>demo</artifactId>
  <version>9.0.11-SNAPSHOT</version>
  <packaging>war</packaging>
  <name>demo</name>
  <url>https://github.com/google/libphonenumber/</url>
  <parent>
    <groupId>com.googlecode.libphonenumber</groupId>
    <artifactId>libphonenumber-parent</artifactId>
    <version>9.0.11-SNAPSHOT</version>
  </parent>

  <properties>
    <app.deploy.project>libphonenumber-hrd</app.deploy.project>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
    <archiveClasses>true</archiveClasses>
    <soy.root>${project.basedir}/src/main/resources/com/google/phonenumbers/demo</soy.root>
    <soy.srcs>${soy.root}/input_form.soy,${soy.root}/result.soy,${soy.root}/result_error.soy,${soy.root}/result_file.soy</soy.srcs>
    <soy.parser.output>${project.build.directory}/generated-sources/com/google/phonenumbers/demo/template/</soy.parser.output>
    <soy.compiler.output>${project.build.directory}/${project.build.finalName}/WEB-INF/lib/soy-templates.jar</soy.compiler.output>
    <soy.package>com.google.phonenumbers.demo.template</soy.package>
  </properties>

  <prerequisites>
    <maven>3.5</maven>
  </prerequisites>

  <dependencies>
    <!-- Compile/runtime dependencies -->
    <dependency>
      <artifactId>soy</artifactId>
      <groupId>com.google.template</groupId>
      <version>2022-07-20</version>
    </dependency>
    <dependency>
      <artifactId>appengine-maven-plugin</artifactId>
      <groupId>com.google.cloud.tools</groupId>
      <version>2.4.4</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5</version>
      <type>jar</type>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.14.0</version>
    </dependency>
    <dependency>
      <groupId>commons-fileupload</groupId>
      <artifactId>commons-fileupload</artifactId>
      <version>1.5</version>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.6</version>
    </dependency>
    <dependency>
      <groupId>com.googlecode.libphonenumber</groupId>
      <artifactId>libphonenumber</artifactId>
      <version>9.0.11-SNAPSHOT</version>
    </dependency>
    <dependency>
      <groupId>com.googlecode.libphonenumber</groupId>
      <artifactId>geocoder</artifactId>
      <version>3.11-SNAPSHOT</version>
    </dependency>
    <dependency>
      <groupId>com.googlecode.libphonenumber</groupId>
      <artifactId>carrier</artifactId>
      <version>2.11-SNAPSHOT</version>
    </dependency>
  </dependencies>

  <build>
    <!-- for hot reload of the web application-->
    <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
    <plugins>
      <plugin>
        <groupId>com.google.cloud.tools</groupId>
        <artifactId>appengine-maven-plugin</artifactId>
        <version>2.4.4</version>
        <configuration>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>8</source>
          <target>8</target>
        </configuration>
        <groupId>org.apache.maven.plugins</groupId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.4.0</version>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <!-- soy-parser generates template classes in
            com.google.phonenumbers.demo.template package -->
            <id>soy-parser</id>
            <goals>
              <goal>exec</goal>
            </goals>
            <phase>generate-sources</phase>
            <configuration>
              <executable>java</executable>
              <arguments>
                <argument>-classpath</argument>
                <classpath />
                <argument>com.google.template.soy.SoyParseInfoGenerator</argument>
                <argument>--generateInvocationBuilders</argument>
                <argument>--javaPackage</argument>
                <argument>${soy.package}</argument>
                <argument>--javaClassNameSource</argument>
                <argument>filename</argument>
                <argument>--srcs</argument>
                <argument>${soy.srcs}</argument>
                <argument>--outputDirectory</argument>
                <argument>${soy.parser.output}</argument>
              </arguments>
              <sourceRoot>${soy.parser.output}</sourceRoot>
            </configuration>
          </execution>
          <execution>
            <!-- soy-compiler compiles templates so that we can use SoySauce
            instead of Tofu. -->
            <id>soy-compiler</id>
            <goals>
              <goal>exec</goal>
            </goals>
            <phase>verify</phase>
            <configuration>
              <executable>java</executable>
              <arguments>
                <argument>-classpath</argument>
                <classpath />
                <argument>com.google.template.soy.SoyToJbcSrcCompiler</argument>
                <argument>--srcs</argument>
                <argument>${soy.srcs}</argument>
                <argument>--output</argument>
                <argument>${soy.compiler.output}</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.5.0</version>
        <configuration>
          <!-- SoyInfoParser does not generate valid javadoc and
          <excludePackageNames> does not work for /generated-sources for
          some reason-->
          <failOnError>false</failOnError>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

