<?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.vaadin</groupId>
  <artifactId>vaadin-parent</artifactId>
  <packaging>pom</packaging>
  <name>Vaadin parent POM</name>
  <version>2.0.1</version>
  <url>http://vaadin.com</url>
  <description>
      A parent POM for all artifacts by Vaadin Ltd.
  </description>
  <developers>
    <developer>
      <id>vaadin</id>
      <organization>Vaadin</organization>
      <organizationUrl>http://vaadin.com</organizationUrl>
    </developer>
  </developers>
  <scm>
    <url>https://github.com/vaadin/maven-integration</url>
    <connection>https://github.com/vaadin/maven-integration.git</connection>
    <developerConnection>https://github.com/vaadin/maven-integration.git</developerConnection>
  </scm>
  <licenses>
    <license>
      <name>Apache License Version 2.0</name>
      <distribution>repo</distribution>
      <url>https://www.apache.org/licenses/LICENSE-2.0</url>
    </license>
  </licenses>
  <distributionManagement>
    <repository>
      <id>vaadin-staging</id>
      <name>Vaadin release staging repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>vaadin-snapshots</id>
      <name>Vaadin snapshot repository</name>
      <url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
    </snapshotRepository>
  </distributionManagement>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  
  <profiles>
    <profile>
      <id>release</id>
      <properties>
        <staging.server.id>vaadin-staging</staging.server.id>
        <staging.server.url>https://oss.sonatype.org/</staging.server.url>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>properties-maven-plugin</artifactId>
            <version>1.0.0</version>
            <configuration>
              <quiet>true</quiet>
            </configuration>
            <executions>
              <execution>
                <phase>initialize</phase>
                <goals>
                  <goal>read-project-properties</goal>
                </goals>
                <configuration>
                  <files>
                    <file>${gpg.passphrase.file}</file>
                  </files>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>1.0</version>
            <executions>
              <execution>
                <id>enforce-maven</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireMavenVersion>
                      <version>(,2.1.0),(2.1.0,2.2.0),(2.2.0,)</version>
                      <message>
                        Maven 2.1.0 and 2.2.0 produce incorrect GPG signatures and checksums
                        respectively.
                      </message>
                    </requireMavenVersion>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
             <groupId>org.sonatype.plugins</groupId>
             <artifactId>nexus-staging-maven-plugin</artifactId>
             <version>1.6.8</version>
             <extensions>true</extensions>
             <configuration>
               <nexusUrl>${staging.server.url}</nexusUrl>
               <serverId>${staging.server.id}</serverId>
             </configuration>
           </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>prerelease</id>
      <properties>
        <staging.server.id>vaadin-prerelease-staging</staging.server.id>
        <!-- staging.server.url is set by the build environment profile -->
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>properties-maven-plugin</artifactId>
            <version>1.0.0</version>
            <configuration>
              <quiet>true</quiet>
            </configuration>
            <executions>
              <execution>
                <phase>initialize</phase>
                <goals>
                  <goal>read-project-properties</goal>
                </goals>
                <configuration>
                  <files>
                    <file>${gpg.passphrase.file}</file>
                  </files>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>1.0</version>
            <executions>
              <execution>
                <id>enforce-maven</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireMavenVersion>
                      <version>(,2.1.0),(2.1.0,2.2.0),(2.2.0,)</version>
                      <message>
                        Maven 2.1.0 and 2.2.0 produce incorrect GPG signatures and checksums
                        respectively.
                      </message>
                    </requireMavenVersion>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
             <groupId>org.sonatype.plugins</groupId>
             <artifactId>nexus-staging-maven-plugin</artifactId>
             <version>1.6.8</version>
             <extensions>true</extensions>
             <configuration>
               <nexusUrl>${staging.server.url}</nexusUrl>
               <serverId>${staging.server.id}</serverId>
             </configuration>
           </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
        <id>apicmp</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>com.github.siom79.japicmp</groupId>
                    <artifactId>japicmp-maven-plugin</artifactId>
                    <version>0.12.0</version>
                    <configuration>
                        <oldVersion>
                            <dependency>
                                <groupId>${project.groupId}</groupId>
                                <artifactId>${project.artifactId}</artifactId>
                                <!--  Needs to be passed as a property via command line e.g. -->
                                <version>${api.reference.version}</version>
                                <type>jar</type>
                            </dependency>
                        </oldVersion>
                        <newVersion>
                            <file>
                                <path>${project.build.directory}/${project.artifactId}-${project.version}.${project.packaging}</path>
                            </file>
                        </newVersion>
                        <parameter>
                            <ignoreMissingClasses>true</ignoreMissingClasses>
                            <onlyModified>true</onlyModified>
                            <skipDiffReport>true</skipDiffReport>
                            <skipXmlReport>true</skipXmlReport>
                            <ignoreMissingOldVersion>true</ignoreMissingOldVersion>
                            <ignoreMissingNewVersion>true</ignoreMissingNewVersion>
                        </parameter>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>verify</phase>
                            <goals>
                                <goal>cmp</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>
  </profiles>

  <build>
    <pluginManagement>
      <plugins>
        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>properties-maven-plugin</artifactId>
                    <versionRange>[1.0-alpha-2,)</versionRange>
                    <goals>
                      <goal>read-project-properties</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>
