<!--
  ~ Copyright 2015 Bronto Software, Inc.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<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>

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>

  <groupId>com.bronto.oss</groupId>
  <artifactId>oss-parent</artifactId>
  <packaging>pom</packaging>
  <version>1.0.0</version>

  <name>Bronto OSS Parent</name>
  <description>Bronto Open Source Software</description>
  <url>https://github.com/bronto</url>

  <organization>
    <name>Bronto Software, Inc.</name>
    <url>https://github.com/bronto</url>
  </organization>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>bronto</id>
      <organization>Bronto Software, Inc.</organization>
      <organizationUrl>https://github.com/bronto</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/bronto/bronto-parent.git</connection>
    <developerConnection>scm:git:git@github.com:bronto/bronto-parent.git</developerConnection>
    <url>https://github.com/bronto/bronto-parent</url>
  </scm>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <!-- Bronto OSS <oss@bronto.com> -->
    <gpg.keyname>CA02BBEA</gpg.keyname>
  </properties>

  <profiles>

    <!-- Profiles that may be activated by a flag file -->
    <!-- These are usually permanent features of a project -->

    <!-- NOTE: Flag files must appear in every module in which they should be activated. -->

    <!-- JDK6 Compiler and Enforcement -->
    <!-- Activated by profile.jdk6 file in project root -->
    <profile>
      <id>jdk6</id>
      <activation>
        <file>
          <exists>${basedir}/profile.jdk6</exists>
        </file>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <!-- maven-compiler-plugin -->
            <plugin>
              <artifactId>maven-compiler-plugin</artifactId>
              <configuration>
                <source>1.6</source>
                <target>1.6</target>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>

              <!-- Enforce Java Version -->
              <execution>
                <id>enforce-java-version</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireJavaVersion>
                      <version>[1.6,)</version>
                    </requireJavaVersion>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- JDK7 Compiler and Enforcement -->
    <!-- Activated by profile.jdk7 file in project root -->
    <profile>
      <id>jdk7</id>
      <activation>
        <file>
          <exists>${basedir}/profile.jdk7</exists>
        </file>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <!-- maven-compiler-plugin -->
            <plugin>
              <artifactId>maven-compiler-plugin</artifactId>
              <configuration>
                <source>1.7</source>
                <target>1.7</target>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>

              <!-- Enforce Java Version -->
              <execution>
                <id>enforce-java-version</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireJavaVersion>
                      <version>[1.7,)</version>
                    </requireJavaVersion>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- JDK8 Compiler and Enforcement -->
    <!-- Activated by profile.jdk8 file in project root -->
    <profile>
      <id>jdk8</id>
      <activation>
        <file>
          <exists>${basedir}/profile.jdk8</exists>
        </file>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <!-- maven-compiler-plugin -->
            <plugin>
              <artifactId>maven-compiler-plugin</artifactId>
              <configuration>
                <source>1.8</source>
                <target>1.8</target>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>

              <!-- Enforce Java Version -->
              <execution>
                <id>enforce-java-version</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireJavaVersion>
                      <version>[1.8,)</version>
                    </requireJavaVersion>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <!-- Enforce Build Constraints -->
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <!-- Enforce Java Version -->
          <execution>
            <id>enforce-java-version</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>[1.6,)</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>

          <!-- Enforce Maven Version -->
          <execution>
            <id>enforce-maven-version</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[3.0,)</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
