<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
   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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>io.syndesis</groupId>
    <artifactId>syndesis-rest-parent</artifactId>
    <version>1.2.2</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>syndesis-maven-plugin</artifactId>
  <name>REST :: Maven Plugin</name>
  <packaging>maven-plugin</packaging>

  <properties>
    <maven.version>3.5.0</maven.version>
    <maven-common-artifact-filters.version>1.4</maven-common-artifact-filters.version>
  </properties>

  <dependencies>

    <dependency>
      <groupId>io.syndesis</groupId>
      <artifactId>core</artifactId>
    </dependency>

    <dependency>
      <groupId>io.syndesis</groupId>
      <artifactId>model</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-web</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework.security</groupId>
          <artifactId>spring-security-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.ws.rs</groupId>
          <artifactId>javax.ws.rs-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>io.atlasmap</groupId>
      <artifactId>atlas-java-model</artifactId>
      <version>${atlasmap.version}</version>
    </dependency>

    <dependency>
      <groupId>io.atlasmap</groupId>
      <artifactId>atlas-java-service</artifactId>
      <version>${atlasmap.version}</version>
    </dependency>

    <dependency>
      <groupId>io.atlasmap</groupId>
      <artifactId>atlas-core</artifactId>
      <version>${atlasmap.version}</version>
    </dependency>

    <dependency>
      <groupId>io.atlasmap</groupId>
      <artifactId>atlas-java-core</artifactId>
      <version>${atlasmap.version}</version>
    </dependency>

    <!-- needed by atlasmap/jackson -->
    <dependency>
      <groupId>javax.ws.rs</groupId>
      <artifactId>javax.ws.rs-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model</artifactId>
      <version>${maven.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${maven.version}</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <groupId>aopalliance</groupId>
          <artifactId>aopalliance</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${maven.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-artifact</artifactId>
      <version>${maven.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>log4j-over-slf4j</artifactId>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>3.5</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-utils</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.resolver</groupId>
      <artifactId>maven-resolver-api</artifactId>
    </dependency>

    <!-- Runtime Dependencies -->
    <dependency>
      <groupId>io.syndesis</groupId>
      <artifactId>rest</artifactId>
      <scope>runtime</scope>
      <exclusions>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-web</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework.security</groupId>
          <artifactId>spring-security-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-beans</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.jboss.spec.javax.annotation</groupId>
          <artifactId>jboss-annotations-api_1.2_spec</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-autoconfigure</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-test</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework.social</groupId>
          <artifactId>spring-social-twitter</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework.social</groupId>
          <artifactId>spring-social-config</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework.social</groupId>
          <artifactId>spring-social-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-test</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework.security</groupId>
          <artifactId>spring-security-crypto</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.github.mikegirard</groupId>
          <artifactId>spring-social-salesforce</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.infinispan</groupId>
          <artifactId>infinispan-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.hibernate.javax.persistence</groupId>
          <artifactId>hibernate-jpa-2.1-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>io.fabric8</groupId>
          <artifactId>kubernetes-client</artifactId>
        </exclusion>
        <exclusion>
          <groupId>io.fabric8</groupId>
          <artifactId>kubernetes-model</artifactId>
        </exclusion>
        <exclusion>
          <groupId>io.swagger</groupId>
          <artifactId>swagger-jaxrs</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-validator</artifactId>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <groupId>org.glassfish</groupId>
      <artifactId>javax.el</artifactId>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <!-- Needed by Guava at compile time -->
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-utils</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.jboss.shrinkwrap.resolver</groupId>
      <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.sonatype.plexus</groupId>
          <artifactId>plexus-sec-dispatcher</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-interpolation</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.maven</groupId>
          <artifactId>maven-repository-metadata</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.maven</groupId>
          <artifactId>maven-aether-provider</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.maven</groupId>
          <artifactId>maven-settings-builder</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-utils</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.jboss.shrinkwrap.resolver</groupId>
      <artifactId>shrinkwrap-resolver-api-maven</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jboss.shrinkwrap.resolver</groupId>
      <artifactId>shrinkwrap-resolver-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-loader-tools</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-shared-utils</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-common-artifact-filters</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.apache.maven</groupId>
          <artifactId>maven-repository-metadata</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-utils</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

  </dependencies>

  <build>
    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.5</version>
        <configuration>
          <mojoDependencies />
        </configuration>
        <executions>
          <execution>
            <id>default-descriptor</id>
            <phase>process-classes</phase>
          </execution>
          <execution>
            <id>help-goal</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.basepom.maven</groupId>
        <artifactId>duplicate-finder-maven-plugin</artifactId>
        <configuration>
          <ignoredClassPatterns>
            <ignoredClassPattern>com.google.common.*</ignoredClassPattern>
            <ignoredClassPattern>org.aopalliance.*</ignoredClassPattern>
            <ignoredClassPattern>org.apache.maven.*</ignoredClassPattern>
            <ignoredClassPattern>org.codehaus.plexus.*</ignoredClassPattern>
            <ignoredClassPattern>org.eclipse.aether.*</ignoredClassPattern>
            <ignoredClassPattern>org.apache.log4j.*</ignoredClassPattern>
            <ignoredClassPattern>org.objectweb.asm.*</ignoredClassPattern>
            <ignoredClassPattern>org.apache.camel.json.simple.*</ignoredClassPattern>
            <ignoredClassPattern>javax.ws.rs.*</ignoredClassPattern>
          </ignoredClassPatterns>
        </configuration>
      </plugin>

      <plugin>
        <groupId>com.ning.maven.plugins</groupId>
        <artifactId>maven-dependency-versions-check-plugin</artifactId>
        <configuration>
          <exceptions>
            <exception>
              <groupId>com.google.guava</groupId>
              <artifactId>guava</artifactId>
              <resolvedVersion>18.0</resolvedVersion>
              <expectedVersion>20.0</expectedVersion>
            </exception>
            <exception>
              <groupId>org.apache.commons</groupId>
              <artifactId>commons-lang3</artifactId>
              <resolvedVersion>3.2.1</resolvedVersion>
              <expectedVersion>3.5</expectedVersion>
            </exception>
            <exception>
              <groupId>org.apache.maven</groupId>
              <artifactId>maven-settings-builder</artifactId>
              <resolvedVersion>3.2.1</resolvedVersion>
              <expectedVersion>3.5.0</expectedVersion>
            </exception>
          </exceptions>
        </configuration>
      </plugin>

      <plugin>
        <groupId>com.hubspot.maven.plugins</groupId>
        <artifactId>dependency-management-maven-plugin</artifactId>
        <configuration>
          <requireManagement>
            <allowExclusions>true</allowExclusions>
          </requireManagement>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <profiles>
    <profile>
      <id>non-m2e</id>
      <activation>
        <!-- active only when not running under M2E in Eclipse -->
        <property>
          <name>!m2e.version</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <compilerArgs combine.children="append">
                <!-- no way to influence generated HelpMojo.java to contain
                the required @Override, or to be marked as @Generated, next
                errorprone version will add exclusions by path:
                -XepExcludedPaths:.*/generated-sources/.*
                -->
                <arg>-Xep:MissingOverride:OFF</arg>
                <!-- no way to influence generated HelpMojo.java not to throw
                from finally block, or to be marked as @Generated, next
                errorprone version will add exclusions by path:
                -XepExcludedPaths:.*/generated-sources/.* -->
                <arg>-Xep:Finally:OFF</arg>
              </compilerArgs>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
