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

  <modelVersion>4.0.0</modelVersion>

  <groupId>se.alipsa</groupId>
  <artifactId>htmlcreator</artifactId>
  <version>1.4.1</version>
  <packaging>jar</packaging>

  <name>Renjin html content creator</name>
  <description>Renjin R package to create html</description>
  <url>https://github.com/perNyfelt/htmlcreator</url>
  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://raw.githubusercontent.com/perNyfelt/htmlcreator/main/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/htmlcreator.git</connection>
    <developerConnection>scm:git:git@github.com:perNyfelt/htmlcreator.git</developerConnection>
    <url>https://github.com/perNyfelt/htmlcreator/tree/main</url>
  </scm>


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

  <dependencies>
    <dependency>
      <groupId>org.renjin</groupId>
      <artifactId>renjin-script-engine</artifactId>
      <version>${renjin.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.30</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.7.30</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>se.alipsa</groupId>
      <artifactId>xmlr</artifactId>
      <version>0.2.1</version>
    </dependency>

    <!-- the hamcrest package is only required if you use it for unit tests -->
    <dependency>
      <groupId>org.renjin</groupId>
      <artifactId>hamcrest</artifactId>
      <version>${renjin.version}</version>
      <scope>test</scope>
    </dependency>
    <!-- the testthat package is only required if you use it for unit tests -->
    <dependency>
      <groupId>org.renjin.cran</groupId>
      <artifactId>testthat</artifactId>
      <version>2.1.1-b2</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <id>bedatadriven</id>
      <name>bedatadriven public repo</name>
      <url>https://nexus.bedatadriven.com/content/groups/public/</url>
    </repository>
    <repository>
      <id>mavencentral</id>
      <name>central</name>
      <url>https://repo1.maven.org/maven2/</url>
    </repository>
  </repositories>

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

  <build>
    <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.3.9,)</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.renjin</groupId>
        <artifactId>renjin-maven-plugin</artifactId>
        <version>${renjin.version}</version>
        <executions>
          <execution>
            <id>build</id>
            <goals>
              <goal>namespace-compile</goal>
            </goals>
            <phase>process-classes</phase>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.30</version>
          </dependency>
          <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.30</version>
          </dependency>
          <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>1.7.30</version>
          </dependency>
        </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>
              <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
              </exclusion>
            </exclusions>
          </dependency>
          <dependency>
            <groupId>org.renjin</groupId>
            <artifactId>hamcrest</artifactId>
            <version>${renjin.version}</version>
          </dependency>
          <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.30</version>
          </dependency>
          <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>1.7.30</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>3.0.0-M5</version>
        <configuration>
          <title>R Tests Report</title>
          <outputName>test-report</outputName>
          <reportsDirectories>${project.build.directory}/renjin-test-reports</reportsDirectories>
          <linkXRef>false</linkXRef>
        </configuration>
        <executions>
          <execution>
            <phase>test</phase>
            <goals>
              <goal>report-only</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-javadoc-plugin</artifactId>
        <version>3.2.0</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- the site plugin will create formatting stuff e.g. css etc. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.9.1</version>
        <configuration>
          <generateReports>false</generateReports>
        </configuration>
        <executions>
          <execution>
            <phase>test</phase>
            <goals>
              <goal>site</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

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