<?xml version="1.0" encoding="UTF-8"?>
<!--

    The MIT License
    Copyright © 2021 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-xml-extra-plugins</artifactId>
    <version>1.0.0</version>

    <name>Kettle XML Extra Plugins</name>
    <description>Plugins for Pentaho Data Integration (KETTLE) with additional functionality for working with XML</description>
    <url>https://github.com/nationalarchives/kettle-xml-extra-plugins</url>

    <inceptionYear>2021</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>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>Adam Retter</name>
            <organization>Evolved Binary</organization>
            <email>adam@evolvedbinary.com</email>
            <organizationUrl>https://www.evolvedbinary.com</organizationUrl>
        </contributor>
    </contributors>

    <scm>
        <connection>scm:git:https://github.com/nationalarchives/kettle-xml-extra-plugins.git</connection>
        <developerConnection>scm:git:https://github.com/nationalarchives/kettle-xml-extra-plugins.git</developerConnection>
        <url>scm:git:https://github.com/nationalarchives/kettle-xml-extra-plugins.git</url>
      <tag>kettle-xml-extra-plugins-1.0.0</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>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <pentaho-kettle.plugins.dir>C:\data-integration9.1\plugins</pentaho-kettle.plugins.dir>
        <pentaho-kettle.version>9.1.0.0-324</pentaho-kettle.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </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>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>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.santuario</groupId>
            <artifactId>xmlsec</artifactId>
            <version>2.2.2</version>
        </dependency>

        <!-- required due to Linkage error within Apache Santuario similar to
         https://documentation.tribefire.com/tribefire.cortex.documentation/concepts-doc/features/tribefire-modules/troubleshooting/slf4j-api-linkage-error.html
         -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
            <version>1.7.12</version>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.7.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.7.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>3.11.2</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>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</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-jdk14:jar:1.7.12</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>
