<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 2011 Tirasa. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License").  You
* may not use this file except in compliance with the License. You can obtain
* a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
* or glassfish/bootstrap/legal/LICENSE.txt.  See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
* Sun designates this particular file as subject to the "Classpath" exception
* as provided by Sun in the GPL Version 2 section of the License file that
* accompanied this code.  If applicable, add the following below the License
* Header, with the fields enclosed by brackets [] replaced by your own
* identifying information: "Portions Copyrighted [year]
* [name of copyright owner]"
*/
-->
<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.connid.bundles.db</groupId>
    <artifactId>db</artifactId>
    <version>2.1.6</version>
  </parent>

  <groupId>org.connid.bundles.db</groupId>
  <artifactId>org.connid.bundles.db.table</artifactId>

  <name>Bundles: DB: Table</name>

  <packaging>jar</packaging>

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

  <dependencies>
    <dependency>
      <groupId>org.connid</groupId>
      <artifactId>connid-framework</artifactId>
    </dependency>

    <dependency>
      <groupId>org.connid</groupId>
      <artifactId>connid-framework-internal</artifactId>
    </dependency>

    <dependency>
      <groupId>org.connid.bundles.db</groupId>
      <artifactId>common</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.connid</groupId>
      <artifactId>connid-test-common</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.connid</groupId>
      <artifactId>connid-test-contract</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.derby</groupId>
      <artifactId>derby</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>
  <profiles>
        
    <profile>
      <id>postgres</id>
            
      <properties>
        <jdbcdriver.groupId>postgresql</jdbcdriver.groupId>
        <jdbcdriver.artifactId>postgresql</jdbcdriver.artifactId>
        <javaagent />
      </properties>
      <dependencies>
        <dependency>
          <groupId>postgresql</groupId>
          <artifactId>postgresql</artifactId>
          <version>9.1-901-1.jdbc4</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <defaultGoal>clean verify</defaultGoal>

        <testResources>
          <testResource>
            <directory>src/test/resources</directory>
            <filtering>true</filtering>
            <excludes>
              <exclude>persistence.properties</exclude>
            </excludes>
          </testResource>
          <testResource>
            <directory>src/test/resources/postgres</directory>
            <filtering>true</filtering>
          </testResource>
        </testResources>
      </build>
    </profile>
        
    <profile>
      <id>mysql</id>
            
      <properties>
        <jdbcdriver.groupId>mysql</jdbcdriver.groupId>
        <jdbcdriver.artifactId>mysql-connector-java</jdbcdriver.artifactId>
        <javaagent />
      </properties>
      <dependencies>
        <dependency>
          <groupId>mysql</groupId>
          <artifactId>mysql-connector-java</artifactId>
          <version>5.1.21</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <defaultGoal>clean verify</defaultGoal>

        <testResources>
          <testResource>
            <directory>src/test/resources</directory>
            <filtering>true</filtering>
            <excludes>
              <exclude>persistence.properties</exclude>
            </excludes>
          </testResource>
          <testResource>
            <directory>src/test/resources/mysql</directory>
            <filtering>true</filtering>
          </testResource>
        </testResources>
      </build>
    </profile>
        
    <profile>
      <id>oracle</id>
      <properties>
        <jdbcdriver.groupId>com.oracle</jdbcdriver.groupId>
        <jdbcdriver.artifactId>ojdbc6</jdbcdriver.artifactId>
        <javaagent />
      </properties>
      <dependencies>
        <dependency>
          <groupId>com.oracle</groupId>
          <artifactId>ojdbc6</artifactId>
          <version>11.1.0</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <defaultGoal>clean verify</defaultGoal>
                
        <testResources>
          <testResource>
            <directory>src/test/resources</directory>
            <filtering>true</filtering>
            <excludes>
              <exclude>persistence.properties</exclude>
            </excludes>
          </testResource>
          <testResource>
            <directory>src/test/resources/oracle</directory>
            <filtering>true</filtering>
          </testResource>
        </testResources>
      </build>
    </profile>
  </profiles>

  <build>
        
    <plugins>
                  
      <!-- Re-enable license header check for this module -->
      <plugin>
        <groupId>com.mycila.maven-license-plugin</groupId>
        <artifactId>maven-license-plugin</artifactId>
        <version>1.9.0</version>
        <executions>
          <execution>
            <id>check-headers</id>
            <phase>verify</phase>
          </execution>
        </executions>
      </plugin>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <includes>
            <include>**/*Tests.java</include>
          </includes>
          <systemPropertyVariables>
            <derby.stream.error.file>target/derby.log</derby.stream.error.file>
          </systemPropertyVariables>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>

          <appendAssemblyId>false</appendAssemblyId>

          <descriptors>
            <descriptor>src/assemble/connector.xml</descriptor>
          </descriptors>

          <archive>
            <index>true</index>
            <manifestEntries>

              <ConnectorBundle-FrameworkVersion>
                ${base.version}
              </ConnectorBundle-FrameworkVersion>

              <ConnectorBundle-Name>
                ${project.artifactId}
              </ConnectorBundle-Name>

              <ConnectorBundle-Version>
                ${project.version}
              </ConnectorBundle-Version>

            </manifestEntries>
          </archive>
                    
        </configuration>
                
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
        
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>true</filtering>
        <excludes>
          <exclude>postgres/**</exclude>
          <exclude>mysql/**</exclude>
          <exclude>oracle/**</exclude>
        </excludes>
      </testResource>
    </testResources>
  </build>
</project>
