<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2016 Red Hat, 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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <!--parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>9</version>
  </parent-->

  <groupId>io.syndesis</groupId>
  <artifactId>syndesis-connectors-project</artifactId>
  <version>0.5.2</version>
  <packaging>pom</packaging>
  <name>Syndesis Connectors :: Project</name>

  <url>https://syndesis.io</url>
  <description>Connectors for Syndesis</description>

  <inceptionYear>2017</inceptionYear>

  <organization>
    <name>Red Hat</name>
    <url>http://redhat.com</url>
  </organization>

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

  <!-- including A developer as it's required by the maven poms going into
    central -->
  <developers>
    <developer>
      <id>syndesis</id>
      <name>Syndesis Development Team</name>
      <url>https://syndesis.io</url>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:syndesisio/connectors.git</connection>
    <developerConnection>scm:git:git@github.com:syndesisio/connectors.git
    </developerConnection>
    <url>https://github.com/syndesisio/connectors/</url>
    <tag>0.5.2</tag>
  </scm>

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

  <repositories>
    <repository>
      <id>jboss-ea</id>
      <name>JBoss Early-access repository</name>
      <url>https://repository.jboss.org/nexus/content/groups/ea/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>    
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>jboss-ea</id>
      <name>JBoss Early-access repository</name>
      <url>https://repository.jboss.org/nexus/content/groups/ea/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>    
  </pluginRepositories>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>

    <spring-boot.version>1.5.6.RELEASE</spring-boot.version>
    <camel.version>2.20.0.fuse-000093</camel.version>

    <!-- maven plugin version -->
    <maven-dependency-plugin.version>3.0.0</maven-dependency-plugin.version>
    <maven-enforcer-plugin.version>1.3.1</maven-enforcer-plugin.version>
    <!-- Stick to 2.18.1 until 2.19.2 is out due to https://issues.apache.org/jira/browse/SUREFIRE-1198 -->
    <maven-failsafe-plugin.version>2.18.1</maven-failsafe-plugin.version>
    <maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
    <maven-jar-plugin.version>3.0.1</maven-jar-plugin.version>
    <maven-javadoc-plugin.version>2.10.3</maven-javadoc-plugin.version>
    <maven-resources-plugin.version>3.0.1</maven-resources-plugin.version>
    <maven-source-plugin.version>2.4</maven-source-plugin.version>
    <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
    <maven-release-plugin.version>2.5.3</maven-release-plugin.version>

    <!-- third party plugin version -->
    <asciidoctor-maven-plugin.version>1.5.3</asciidoctor-maven-plugin.version>
    <build-helper-maven-plugin.version>1.12</build-helper-maven-plugin.version>
    <fabric8-maven-plugin.version>3.2.15</fabric8-maven-plugin.version>
    <git-commit-id-plugin.version>2.2.2</git-commit-id-plugin.version>
    <jacoco-maven-plugin.version>0.7.8</jacoco-maven-plugin.version>
    <license-maven-plugin.version>3.0</license-maven-plugin.version>
    <templating-maven-plugin.version>1.0.0</templating-maven-plugin.version>
  </properties>

  <modules>
    <module>components</module>
    <module>connectors</module>
    <module>connector-verify</module>
    <module>examples</module>
    <module>catalog</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <!-- Import Boms -->
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring-boot.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <version>${spring-boot.version}</version>
        </plugin>
        <plugin>
          <groupId>org.asciidoctor</groupId>
          <artifactId>asciidoctor-maven-plugin</artifactId>
          <version>${asciidoctor-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>${build-helper-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${maven-failsafe-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>pl.project13.maven</groupId>
          <artifactId>git-commit-id-plugin</artifactId>
          <version>${git-commit-id-plugin.version}</version>
          <executions>
            <execution>
              <goals>
                <goal>revision</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <verbose>true</verbose>
            <dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
            <generateGitPropertiesFile>true</generateGitPropertiesFile>
            <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>${maven-dependency-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>${maven-release-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>templating-maven-plugin</artifactId>
        <version>${templating-maven-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>filter-sources</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <inherited>true</inherited>
        <version>${maven-surefire-plugin.version}</version>
        <configuration>
          <environmentVariables>
            <ENV_VAR_EXISTS>value</ENV_VAR_EXISTS>
            <ENV_VAR_EXISTS_BOOLEAN>true</ENV_VAR_EXISTS_BOOLEAN>
          </environmentVariables>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>${maven-gpg-plugin.version}</version>
        <configuration>
          <passphrase>${gpg.passphrase}</passphrase>
          <useAgent>true</useAgent>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${jacoco-maven-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
              <goal>prepare-agent-integration</goal>
              <goal>report</goal>
              <goal>report-integration</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${license-maven-plugin.version}</version>
        <configuration>
          <aggregate>true</aggregate>
          <header>header.txt</header>
          <properties>
            <owner>Red Hat, Inc.</owner>
          </properties>
          <excludes>
            <exclude>.editorconfig</exclude>
            <exclude>license.txt</exclude>
            <exclude>**/*.adoc</exclude>
            <exclude>.mention-bot</exclude>
            <exclude>.mvn/wrapper/maven-wrapper.properties</exclude>
            <exclude>mvnw*</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <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.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>${maven-enforcer-plugin.version}</version>
            <executions>
              <execution>
                <id>enforce-no-snapshots</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireReleaseDeps>
                      <message>No Snapshots Allowed!</message>
                    </requireReleaseDeps>
                  </rules>
                  <fail>false</fail>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven-javadoc-plugin.version}</version>
            <configuration>
              <includeDependencySources>${javadoc.include.deps}
              </includeDependencySources>
              <dependencySourceIncludes>
                <dependencySourceInclude>${javadoc.source.includes}
                </dependencySourceInclude>
              </dependencySourceIncludes>
              <excludePackageNames>${javadoc.package.excludes}</excludePackageNames>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <additionalparam>${javadoc.opts}</additionalparam>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>${maven-source-plugin.version}</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>doclint-java8-disable</id>
      <activation>
        <jdk>[1.8,)</jdk>
      </activation>
      <properties>
        <javadoc.opts>-Xdoclint:none</javadoc.opts>
      </properties>
    </profile>
  </profiles>
</project>

