<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License.  You may obtain a copy of the License at
  ~
  ~       http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->
<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.apache.hop</groupId>
        <artifactId>hop</artifactId>
        <version>2.19.0</version>
    </parent>

    <artifactId>hop-plugins</artifactId>
    <packaging>pom</packaging>
    <name>Hop Plugins</name>

    <modules>
        <module>actions</module>
        <module>databases</module>
        <module>engines</module>
        <module>misc</module>
        <module>resolvers</module>
        <module>tech</module>
        <module>transforms</module>
        <module>valuetypes</module>
    </modules>

    <properties>
        <hop.jdbc.driver1>none:none</hop.jdbc.driver1>
        <hop.jdbc.driver2>none:none</hop.jdbc.driver2>
        <hop.jdbc.driver3>none:none</hop.jdbc.driver3>
        <hop.libcore.exclude1>none:none</hop.libcore.exclude1>
        <hop.libcore.exclude2>none:none</hop.libcore.exclude2>
        <hop.libcore.exclude3>none:none</hop.libcore.exclude3>
        <hop.libcore.exclude4>none:none</hop.libcore.exclude4>
        <hop.libcore.exclude5>none:none</hop.libcore.exclude5>
        <hop.plugin.lib.dir>${hop.plugin.libdir}/lib</hop.plugin.lib.dir>
        <hop.pluginlib.exclude1>none</hop.pluginlib.exclude1>
        <hop.pluginlib.exclude2>none</hop.pluginlib.exclude2>
        <hop.pluginlib.exclude3>none</hop.pluginlib.exclude3>
        <hop.pluginlib.exclude4>none</hop.pluginlib.exclude4>
        <hop.pluginlib.exclude5>none</hop.pluginlib.exclude5>
    </properties>

    <dependencies>
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <version>6.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.hop</groupId>
            <artifactId>hop-core</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.hop</groupId>
            <artifactId>hop-engine</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.hop</groupId>
            <artifactId>hop-ui</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.platform</groupId>
            <artifactId>${swt.artifactId}</artifactId>
            <version>${org.eclipse.platform.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.hop</groupId>
            <artifactId>hop-core</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.hop</groupId>
            <artifactId>hop-engine</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>

        <!-- SWTBot UI-test stack, available to any plugin that adds a @Tag("uitest") test extending
             org.apache.hop.ui.testing.SwtBotTestBase. hop-ui/core/engine/SWT are already provided
             above; these add the harness, the standalone look-and-feel impls, and the SWTBot jars
             (hamcrest/slf4j/junit4 come transitively from the swtbot wrapper). All test-scope, so
             non-UI plugins carry them on the test classpath only and are otherwise unaffected. -->
        <dependency>
            <groupId>org.apache.hop</groupId>
            <artifactId>hop-ui</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.hop</groupId>
            <artifactId>hop-ui-rcp</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- The lib-p2 wrapper carries the Hop version, not the wrapped SWTBot version. -->
        <dependency>
            <groupId>org.eclipse</groupId>
            <artifactId>org.eclipse.swtbot.swt.finder</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse</groupId>
            <artifactId>org.eclipse.swtbot.swt.finder</artifactId>
            <version>${project.version}</version>
            <classifier>junit5</classifier>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <!-- The SWTBot UI-test stack above is on every plugin's test classpath. The @Tag("uitest")
         gating and the uitest / swtbot-mac profiles are inherited from the root pom, so a plugin
         needs no extra config to add a UI test extending org.apache.hop.ui.testing.SwtBotTestBase. -->

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>derive-hop-plugin-libdir</id>
                        <goals>
                            <goal>regex-property</goal>
                        </goals>
                        <phase>initialize</phase>
                        <configuration>
                            <name>hop.plugin.libdir</name>
                            <value>${project.basedir}</value>
                            <regex>^.*?[/\\](plugins([/\\].*)?)$</regex>
                            <replacement>$1</replacement>
                            <failIfNoMatch>false</failIfNoMatch>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.8.1</version>
                <executions>
                    <execution>
                        <id>stage-plugin-lib</id>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <phase>prepare-package</phase>
                        <configuration>
                            <includeScope>runtime</includeScope>
                            <outputDirectory>${project.build.directory}/hop-plugin-lib</outputDirectory>
                            <excludeGroupIds>org.apache.hop,org.slf4j,org.eclipse.platform</excludeGroupIds>
                            <excludeArtifactIds>lombok,jakarta.servlet-api,redshift-jdbc42,clickhouse-jdbc,h2,mssql-jdbc,mysql-connector-j,vertica-jdbc,crate-jdbc,ucanaccess,monetdb-jdbc,jt400,snowflake-jdbc,derbyclient,duckdb_jdbc,hsqldb,postgresql,sqlite-jdbc,${hop.pluginlib.exclude1},${hop.pluginlib.exclude2},${hop.pluginlib.exclude3},${hop.pluginlib.exclude4},${hop.pluginlib.exclude5}</excludeArtifactIds>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
