<!--

    The MIT License
    Copyright © 2020 The National Archives

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.

-->
<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>uk.gov.nationalarchives.pdi</groupId>
  <artifactId>kettle-jena-plugins</artifactId>
  <version>2.2.1</version>
  <packaging>jar</packaging>

  <name>Kettle Jena Plugins</name>
  <description>Apache Jena Plugins for Pentaho Data Integration (KETTLE) for producing RDF</description>
  <url>https://github.com/nationalarchives/kettle-jena-plugins</url>

  <inceptionYear>2020</inceptionYear>

  <organization>
    <name>The National Archives</name>
    <url>https://nationalarchives.gov.uk</url>
  </organization>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://opensource.org/licenses/MIT</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Adam Retter</name>
      <organization>Evolved Binary</organization>
      <email>adam@evolvedbinary.com</email>
      <organizationUrl>https://www.evolvedbinary.com</organizationUrl>
    </developer>
    <developer>
      <name>Rob Walpole</name>
      <organization>DeveXe</organization>
      <email>rob.walpole@devexe.co.uk </email>
      <organizationUrl>https://www.devexe.co.uk</organizationUrl>
    </developer>
  </developers>

  <contributors>
    <contributor>
      <name>Samu Lang</name>
    </contributor>
  </contributors>

  <scm>
    <connection>scm:git:https://github.com/nationalarchives/kettle-jena-plugins.git</connection>
    <developerConnection>scm:git:https://github.com/nationalarchives/kettle-jena-plugins.git</developerConnection>
    <url>scm:git:https://github.com/nationalarchives/kettle-jena-plugins.git</url>
    <tag>kettle-jena-plugins-2.2.1</tag>
  </scm>

  <repositories>
    <repository>
      <id>pentaho-nexus</id>
      <name>PentahoNexus</name>
      <url>https://nexus.pentaho.org/content/groups/omni</url>
    </repository>
  </repositories>

  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Nexus Snapshots Repository</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Nexus Release Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <properties>
    <pentaho-kettle.version>9.1.0.0-324</pentaho-kettle.version>
    <pentaho-kettle.plugins.dir>C:\data-integration9.1\plugins</pentaho-kettle.plugins.dir>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.source.version>1.8</java.source.version>
    <java.target.version>1.8</java.target.version>
    <jena.version>3.17.0</jena.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>pentaho-kettle</groupId>
      <artifactId>kettle-core</artifactId>
      <version>${pentaho-kettle.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>pentaho-kettle</groupId>
      <artifactId>kettle-engine</artifactId>
      <version>${pentaho-kettle.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>pentaho-kettle</groupId>
      <artifactId>kettle-ui-swt</artifactId>
      <version>${pentaho-kettle.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>pentaho</groupId>
      <artifactId>pentaho-metaverse-api</artifactId>
      <version>${pentaho-kettle.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>pentaho</groupId>
      <artifactId>metastore</artifactId>
      <version>${pentaho-kettle.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.eclipse.swt</groupId>
      <artifactId>org.eclipse.swt.gtk.linux.x86_64</artifactId>
      <version>4.6</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>xml-apis</groupId>
      <artifactId>xml-apis</artifactId>
      <version>1.4.01</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.jena</groupId>
      <artifactId>jena-core</artifactId>
      <version>${jena.version}</version>
      <exclusions>
        <!-- provided by pentaho-kettle -->
        <exclusion>
          <groupId>commons-codec</groupId>
          <artifactId>commons-codec</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-cli</groupId>
          <artifactId>commons-cli</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-io</groupId>
          <artifactId>commons-io</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-lang3</groupId>
          <artifactId>commons-lang3</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.apache.jena</groupId>
      <artifactId>jena-shacl</artifactId>
      <version>${jena.version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.apache.jena</groupId>
      <artifactId>jena-arq</artifactId>
      <version>${jena.version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>3.0.2</version>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>5.6.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>5.6.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>3.4.0</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>1.7.30</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>pentaho-kettle</groupId>
      <artifactId>kettle-core</artifactId>
      <version>${pentaho-kettle.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>pentaho-kettle</groupId>
      <artifactId>kettle-engine</artifactId>
      <version>${pentaho-kettle.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
          <encoding>${project.build.sourceEncoding}</encoding>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>4.1</version>
        <configuration>
          <licenseSets>
            <licenseSet>
              <header>com/mycila/maven/plugin/license/templates/MIT.txt</header>
              <properties>
                <owner>${project.organization.name}</owner>
              </properties>
              <excludes>
                <exclude>.github/</exclude>
                <exclude>.gitignore</exclude>
                <exclude>.travis.yml</exclude>
                <exclude>appveyor.yml</exclude>
                <exclude>README.md</exclude>
                <exclude>README.md.BAK</exclude>
                <exclude>LICENSE</exclude>
              </excludes>
            </licenseSet>
          </licenseSets>
          <failIfMissing>true</failIfMissing>
          <strictCheck>true</strictCheck>
          <mapping>
            <ktr>XML_STYLE</ktr>
          </mapping>
          <encoding>${project.build.sourceEncoding}</encoding>
        </configuration>
        <executions>
          <execution>
            <id>check-headers</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <encoding>${project.build.sourceEncoding}</encoding>
          <source>${java.source.version}</source>
          <target>${java.target.version}</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.1.1</version>
        <executions>
          <execution>
            <id>analyze</id>
            <goals>
              <goal>analyze-only</goal>
            </goals>
            <configuration>
              <failOnWarning>true</failOnWarning>
              <ignoredUsedUndeclaredDependencies>
                <ignoredUsedUndeclaredDependency>wsdl4j:wsdl4j-qname</ignoredUsedUndeclaredDependency>
              </ignoredUsedUndeclaredDependencies>
              <ignoredUnusedDeclaredDependencies>
                <!-- used at runtime for test scope -->
                <ignoredUnusedDeclaredDependency>org.junit.jupiter:junit-jupiter-engine</ignoredUnusedDeclaredDependency>
                <ignoredUnusedDeclaredDependency>org.slf4j:slf4j-simple</ignoredUnusedDeclaredDependency>
                <ignoredUnusedDeclaredDependency>pentaho-kettle:kettle-core:jar:${pentaho-kettle.version}</ignoredUnusedDeclaredDependency>
              </ignoredUnusedDeclaredDependencies>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.code54.mojo</groupId>
        <artifactId>buildversion-plugin</artifactId>
        <version>1.0.3</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>set-properties</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.2.0</version>
        <configuration>
          <archive>
            <manifest>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
            <manifestEntries>
              <Build-Tag>${build-tag}</Build-Tag>
              <Git-Commit>${build-commit}</Git-Commit>
              <Git-Commit-Abbrev>${build-commit-abbrev}</Git-Commit-Abbrev>
              <Build-Version>${build-version}</Build-Version>
              <Build-Timestamp>${build-tstamp}</Build-Timestamp>
              <Source-Repository>${project.scm.connection}</Source-Repository>
              <Description>${project.description}</Description>
              <Implementation-URL>${project.url}</Implementation-URL>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <!-- Attach source jar -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.2.1</version>
        <configuration>
          <archive>
            <manifest>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
            <manifestEntries>
              <Build-Tag>${build-tag}</Build-Tag>
              <Git-Commit>${build-commit}</Git-Commit>
              <Git-Commit-Abbrev>${build-commit-abbrev}</Git-Commit-Abbrev>
              <Build-Version>${build-version}</Build-Version>
              <Build-Timestamp>${build-tstamp}</Build-Timestamp>
              <Source-Repository>${project.scm.connection}</Source-Repository>
              <Description>${project.description}</Description>
              <Implementation-URL>${project.url}</Implementation-URL>
            </manifestEntries>
          </archive>
        </configuration>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!-- Attach javadoc jar -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.3.1</version>
        <configuration>
          <source>${project.build.source}</source>
          <archive>
            <manifest>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
            <manifestEntries>
              <Build-Tag>${build-tag}</Build-Tag>
              <Git-Commit>${build-commit}</Git-Commit>
              <Git-Commit-Abbrev>${build-commit-abbrev}</Git-Commit-Abbrev>
              <Build-Version>${build-version}</Build-Version>
              <Build-Timestamp>${build-tstamp}</Build-Timestamp>
              <Source-Repository>${project.scm.connection}</Source-Repository>
              <Description>${project.description}</Description>
              <Implementation-URL>${project.url}</Implementation-URL>
            </manifestEntries>
          </archive>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.7</version>
        <configuration>
          <propertyName>jacocoArgLine</propertyName>
        </configuration>
        <executions>
          <execution>
            <id>default-prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.0.0-M5</version>
        <configuration>
          <argLine>@{jacocoArgLine} -Dfile.encoding=${project.build.sourceEncoding}</argLine>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>3.0.0-M5</version>
        <configuration>
          <argLine>@{jacocoArgLine} -Dfile.encoding=${project.build.sourceEncoding}</argLine>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>3.2.0</version>
        <configuration>
          <descriptors>
            <descriptor>src/assembly/plugin-dir.xml</descriptor>
          </descriptors>
        </configuration>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.9.1</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>3.1.2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>3.0.0-M4</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.7</version>
        <reportSets>
          <reportSet>
            <reports>
              <!-- select non-aggregate reports -->
              <report>report</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

  <profiles>

    <profile>
      <id>upload-jacoco-to-coveralls</id>
      <activation>
        <!-- enabled in CI environment i.e. GitHub Actions -->
        <property>
          <name>env.CI</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.eluder.coveralls</groupId>
            <artifactId>coveralls-maven-plugin</artifactId>
            <version>4.3.0</version>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>deploy-pdi-local</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>3.0.0</version>
            <executions>
              <execution>
                <id>deploy-to-pdi</id>
                <goals>
                  <goal>run</goal>
                </goals>
                <phase>deploy</phase>
                <configuration>
                  <target>
                    <copy verbose="true" todir="${pentaho-kettle.plugins.dir}">
                      <fileset dir="${project.build.directory}/${project.artifactId}-${project.version}-kettle-plugin" />
                    </copy>
                  </target>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>
</project>
