<?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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>io.syndesis</groupId>
    <artifactId>connectors</artifactId>
    <version>0.5.8</version>
  </parent>

  <artifactId>sql-stored-connector</artifactId>
  <packaging>jar</packaging>
  <name>Syndesis Connectors :: Sql Stored Connector</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <camel.version>2.20.0.fuse-000091</camel.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <!-- Camel BOM -->
      <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-parent</artifactId>
        <version>${camel.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>

    <!-- base component to use for this connector -->
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-sql</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-sql-starter</artifactId>
    </dependency>

    <!-- camel-connector -->
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-connector</artifactId>
    </dependency>

    <!-- camel and spring boot compiler plugins -->
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>apt</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-configuration-processor</artifactId>
      <version>${spring-boot.version}</version>
    </dependency>

    <dependency>
      <groupId>commons-dbcp</groupId>
      <artifactId>commons-dbcp</artifactId>
    </dependency>

    <!--  supported drivers -->
    <dependency>
      <groupId>org.apache.derby</groupId>
      <artifactId>derby</artifactId>
    </dependency>
    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
    </dependency>
    <!-- The Oracle Driver needs to be added manually by user, for licensing compliance
    it can not be shipped. We need to provide some mechnism so the integrator can upload
    this jar. (http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html)
    <dependency>
      <groupId>oracle</groupId>
      <artifactId>jdbc</artifactId>
      <version>12.0</version>
      <scope>system</scope>
      <systemPath>ojdbc8.jar</systemPath>
    </dependency>
     -->

    <!-- logging -->
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j-impl</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- testing -->
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.module</groupId>
      <artifactId>jackson-module-jsonSchema</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
    </dependency>
  </dependencies>

  <build>
    <defaultGoal>install</defaultGoal>

    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>

    <plugins>

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

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.0.1</version>
        <configuration>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>

      <plugin>
        <groupId>com.coderplus.maven.plugins</groupId>
        <artifactId>copy-rename-maven-plugin</artifactId>
        <version>1.0.1</version>
        <executions>
          <execution>
            <id>copy-camel-schema</id>
            <phase>process-classes</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <sourceFile>${project.build.directory}/classes/camel-connector-schema.json</sourceFile>
              <destinationFile>${project.build.directory}/classes/io/syndesis/connector/sql-stored-connector.json</destinationFile>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- generate components meta-data and validate component includes documentation etc
      Disabled until the plugin supports adding parameters at the connector level. At the moment
     they are added manually.
      <plugin>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-package-maven-plugin</artifactId>
        <version>${camel.version}</version>
        <executions>
          <execution>
            <id>prepare</id>
            <goals>
              <goal>prepare-components</goal>
            </goals>
            <phase>generate-resources</phase>
          </execution>
          <execution>
            <id>validate</id>
            <goals>
              <goal>validate-components</goal>
            </goals>
            <phase>prepare-package</phase>
          </execution>
        </executions>
      </plugin>
      -->

      <!-- generate connector
      <plugin>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-connector-maven-plugin</artifactId>
        <version>${camel.version}</version>
        <executions>
          <execution>
            <id>boot</id>
            <goals>
              <goal>prepare-spring-boot-auto-configuration</goal>
            </goals>
            <configuration>

              <includeLicenseHeader>false</includeLicenseHeader>

              <configurationPrefix>false</configurationPrefix>
            </configuration>
          </execution>
          <execution>
            <id>connector</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      -->

    </plugins>
  </build>

  <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>


</project>
