<?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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.google.appengine</groupId>
  <artifactId>gcloud-maven-plugin</artifactId>
  <packaging>maven-plugin</packaging>
  <version>2.0.9.92.v20160118</version>
  <name>A Maven Plugin using the Cloud SDK for running and deploying appengine applications</name>
  <description>
    The App Engine maven plugin which can be used to interact with
    both the development server and the remote runtime.
  </description>
  <url>https://developers.google.com/appengine/docs/java/tools/maven</url>

  <inceptionYear>2014</inceptionYear>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <appengine.target.version>1.9.31</appengine.target.version>
    <datanucleus.version>3.2.0-m1</datanucleus.version>
  </properties>

  <prerequisites>
    <maven>3.1.0</maven>
  </prerequisites>

  <scm>
    <connection>scm:git:https://github.com/ludoch/gcloud-maven-plugin.git</connection>
    <tag>gcloud-maven-plugin-2.0.9.92.v20160118</tag>
  </scm>

  <developers>
    <developer>
      <id>ludo</id>
      <name>Ludovic Champenois</name>
      <organization>Google</organization>
      <email>ludo at google dot com</email>
    </developer>
    <developer>
      <id>rrch</id>
      <name>Roberto Chinnici</name>
      <organization>Google</organization>
      <email>rrch at google dot com</email>
    </developer>
  </developers>

  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <repositories>
    <repository>
      <id>sonatype-google-releases</id>
      <name>Sonatype Google Releases</name>
      <url>https://oss.sonatype.org/service/local/repositories/google-releases/content</url>
    </repository>
  </repositories>

  <distributionManagement>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Sonatype Nexus Staging</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/google-snapshots/</url>
    </snapshotRepository>
  </distributionManagement>

 <dependencies>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-io</artifactId>
      <version>1.3.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>3.2.3</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>3.2.3</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model</artifactId>
      <version>3.2.3</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.aether</groupId>
      <artifactId>aether-api</artifactId>
      <version>1.0.0.v20140518</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.aether</groupId>
      <artifactId>aether-util</artifactId>
      <version>1.0.0.v20140518</version>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>18.0</version>
    </dependency>
    <dependency>
      <groupId>com.google.appengine</groupId>
      <artifactId>appengine-tools-sdk</artifactId>
      <version>${appengine.target.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.appengine</groupId>
      <artifactId>appengine-local-endpoints</artifactId>
      <version>${appengine.target.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.appengine</groupId>
      <artifactId>appengine-endpoints</artifactId>
      <version>${appengine.target.version}</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5</version>
    </dependency>
    <dependency>
      <groupId>eu.infomas</groupId>
      <artifactId>annotation-detector</artifactId>
      <version>3.0.4</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-nop</artifactId>
      <version>1.7.7</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-invoker</artifactId>
      <version>2.1.1</version>
      <type>jar</type>
    </dependency>
    <dependency>
      <groupId>org.ini4j</groupId>
      <artifactId>ini4j</artifactId>
      <version>0.5.4</version>
    </dependency>    
  </dependencies>

  <build>

    <plugins>
      <plugin>
        <groupId>com.mycila.maven-license-plugin</groupId>
        <artifactId>maven-license-plugin</artifactId>
        <version>1.10.b1</version>
        <configuration>
          <header>header.txt</header>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.3.1</version>
        <executions>
          <execution>
            <id>enforce-versions</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>3.1.0</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>1.7</version>
                </requireJavaVersion>
                <requireReleaseDeps />
                <bannedDependencies>
                  <excludes>
                    <exclude>com.google.appengine</exclude>
                  </excludes>
                  <includes>
                    <include>com.google.appengine:*:${appengine.target.version}</include>
                  </includes>
                </bannedDependencies>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.17</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.4</version>
          <configuration>
            <attach>true</attach>
          </configuration>
          <executions>
            <execution>
              <id>create-source-jar</id>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.2</version>
          <configuration>
            <source>1.7</source>
            <target>1.7</target>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.2</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.7</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.1</version>
          <configuration>
            <docletArtifact>
              <groupId>com.google.doclava</groupId>
              <artifactId>doclava</artifactId>
              <version>1.0.2</version>
            </docletArtifact>
            <doclet>com.google.doclava.Doclava</doclet>
            <!--
              | bootclasspath required by Sun's JVM
            -->
            <bootclasspath>${sun.boot.class.path}</bootclasspath>
            <additionalparam>
              -quiet
              -federate JDK http://download.oracle.com/javase/6/docs/api/index.html?
              -federate AppEngine https://developers.google.com/appengine/docs/java/javadoc/
              -federationxml JDK
              http://doclava.googlecode.com/svn/static/api/openjdk-6.xml
              -hdf project.name "${project.name}"
              -d ${project.build.directory}/apidocs
            </additionalparam>
            <useStandardDocletOptions>false</useStandardDocletOptions>
            <!--
              | Apple's JVM sometimes requires more memory
            -->
            <additionalJOption>-J-Xmx1024m</additionalJOption>
            <skip>true</skip>
          </configuration>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5.1</version>
          <configuration>
            <mavenExecutorId>forked-path</mavenExecutorId>
            <useReleaseProfile>false</useReleaseProfile>
            <arguments>-Psonatype-oss-release</arguments>
            <pushChanges>false</pushChanges>
            <localCheckout>true</localCheckout>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-invoker-plugin</artifactId>
          <version>1.10</version>
          <configuration>
            <projectsDirectory>src/it</projectsDirectory>
            <pomIncludes>
              <pomInclude>*/pom.xml</pomInclude>
            </pomIncludes>
            <postBuildHookScript>verify</postBuildHookScript>
            <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
            <goals>
              <goal>gcloud:run_start</goal> <!-- stop will happen in the verify.bsh script-->
              <goal>gcloud:deploy</goal>
            </goals>
            <settingsFile>src/it/settings.xml</settingsFile>
            <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
            <cloneClean>true</cloneClean>
          </configuration>
          <executions>
            <execution>
              <id>integration-test</id>
              <goals>
                <goal>install</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>sonatype-oss-release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.5</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
