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

  <groupId>se.alipsa</groupId>
  <artifactId>R2JDBC</artifactId>
  <version>10.0.25</version>
  <packaging>jar</packaging>

  <name>R2JDBC</name>
  <description>Provides access to databases for Renjin R programs through the JDBC interface</description>
  <url>https://github.com/perNyfelt/r2jdbc</url>
  <licenses>
    <license>
      <name>MIT</name>
      <url>https://github.com/perNyfelt/r2jdbc/blob/master/LICENSE</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Per Nyfelt</name>
      <email>per.nyfelt@alipsa.se</email>
      <organization>Alipsa HB</organization>
      <organizationUrl>http://www.alipsa.se</organizationUrl>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:https://github.com/perNyfelt/r2jdbc.git</connection>
    <developerConnection>scm:git:https://github.com/perNyfelt/r2jdbc.git</developerConnection>
    <url>https://github.com/perNyfelt/r2jdbc/tree/master</url>
  </scm>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <renjin.version>3.5-beta76</renjin.version>
    <dbi.version>[1.0.0-b9,)</dbi.version>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <slf4j.version>1.7.35</slf4j.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.renjin.cran</groupId>
      <artifactId>DBI</artifactId>
      <version>${dbi.version}</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <groupId>org.renjin</groupId>
          <artifactId>tcltk</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.renjin</groupId>
          <artifactId>methods</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.renjin</groupId>
          <artifactId>graphics</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.renjin</groupId>
          <artifactId>datasets</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.renjin</groupId>
          <artifactId>splines</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.renjin</groupId>
          <artifactId>grDevices</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.renjin</groupId>
          <artifactId>tools</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.renjin</groupId>
          <artifactId>stats</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.renjin</groupId>
          <artifactId>parallel</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.renjin</groupId>
          <artifactId>utils</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.renjin</groupId>
          <artifactId>grid</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.renjin</groupId>
          <artifactId>stats4</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.renjin</groupId>
      <artifactId>renjin-script-engine</artifactId>
      <version>${renjin.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.renjin</groupId>
      <artifactId>hamcrest</artifactId>
      <version>${renjin.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.renjin.cran</groupId>
      <artifactId>testthat</artifactId>
      <version>2.1.1-b2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.derby</groupId>
      <artifactId>derby</artifactId>
      <!-- 10.15 support java 9 and later only -->
      <version>10.14.2.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <version>2.1.210</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.microsoft.sqlserver</groupId>
      <artifactId>mssql-jdbc</artifactId>
      <version>9.4.1.jre8</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>testcontainers</artifactId>
      <version>1.16.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>mssqlserver</artifactId>
      <version>1.16.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>postgresql</artifactId>
      <version>1.16.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>42.3.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>${slf4j.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.renjin</groupId>
          <artifactId>renjin-maven-plugin</artifactId>
          <version>${renjin.version}</version>
          <executions>
            <execution>
              <id>build</id>
              <goals>
                <goal>namespace-compile</goal>
              </goals>
              <phase>compile</phase>
            </execution>
            <!--execution>
                <id>test</id>
                <goals>
                    <goal>test</goal>
                </goals>
                <phase>test</phase>
            </execution-->
          </executions>
          <configuration>
            <defaultPackages>
              <defaultPackage>methods</defaultPackage>
            </defaultPackages>
          </configuration>
          <dependencies>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>se.alipsa</groupId>
          <artifactId>renjin-test-maven-plugin</artifactId>
          <version>1.3.6</version>
          <configuration>
            <testFailureIgnore>false</testFailureIgnore>
          </configuration>
          <executions>
            <execution>
              <phase>test</phase>
              <goals>
                <goal>testR</goal>
              </goals>
            </execution>
          </executions>
          <dependencies>
            <dependency>
              <groupId>org.renjin</groupId>
              <artifactId>renjin-script-engine</artifactId>
              <version>${renjin.version}</version>
              <exclusions>
                <!-- optional but needed if you use e.g.slf4j (then use the jcl bridge instead) -->
                <exclusion>
                  <groupId>commons-logging</groupId>
                  <artifactId>commons-logging</artifactId>
                </exclusion>
              </exclusions>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.2</version>
          <configuration>
            <testFailureIgnore>false</testFailureIgnore>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <id>enforce-releases-maven-java</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[3.5.2,)</version>
                  <level>ERROR</level>
                  <message>Please use maven version 3.5.2 or higher</message>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>1.8.0</version>
                  <level>WARN</level>
                  <message>Please use Java 8</message>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>versions-maven-plugin</artifactId>
        <version>2.9.0</version>
        <configuration>
          <rulesUri>file://${basedir}/version-plugin-rules.xml</rulesUri>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.renjin</groupId>
        <artifactId>renjin-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>se.alipsa</groupId>
        <artifactId>renjin-test-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.9.0</version>
        <configuration>
          <source>${maven.compiler.source}</source>
          <target>${maven.compiler.target}</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.3.1</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.2.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>3.0.0-M5</version>
        <executions>
          <execution>
            <id>junit</id>
            <phase>test</phase>
            <goals>
              <goal>report-only</goal>
            </goals>
          </execution>
          <execution>
            <id>hamcrest</id>
            <phase>test</phase>
            <goals>
              <goal>report-only</goal>
            </goals>
            <configuration>
              <title>Hamcrest R Tests Report</title>
              <outputName>hamcrest-report</outputName>
              <reportsDirectories>${project.build.directory}/renjin-hamcrest-test-reports
              </reportsDirectories>
              <linkXRef>false</linkXRef>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.10.0</version>
        <configuration>
          <generateReports>false</generateReports>
        </configuration>
        <executions>
          <execution>
            <phase>test</phase>
            <goals>
              <goal>site</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <repositories>
    <repository>
      <id>bedatadriven</id>
      <name>bedatadriven public repo</name>
      <url>https://nexus.bedatadriven.com/content/groups/public/</url>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>bedatadriven</id>
      <name>bedatadriven public repo</name>
      <url>https://nexus.bedatadriven.com/content/groups/public/</url>
    </pluginRepository>
  </pluginRepositories>

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

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <!-- See https://central.sonatype.org/pages/apache-maven.html for details -->
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>