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

<!-- SPDX-License-Identifier: Apache-2.0 -->
<!-- Copyright Contributors to the ODPi Egeria project. -->

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

    <parent>
        <artifactId>open-metadata-archives</artifactId>
        <groupId>org.odpi.egeria</groupId>
        <version>3.3</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>

    <scm>
        <connection>scm:git:git://github.com/odpi/egeria.git</connection>
        <developerConnection>scm:git:ssh://github.com/odpi/egeria.git</developerConnection>
        <url>http://github.com/odpi/egeria/tree/master</url>
    </scm>

    <name>Open Connector Archives</name>
    <description>
        The Open Connector Archives provide utilities for loading definitions for open connectors.
    </description>

    <artifactId>open-connector-archives</artifactId>

    <dependencies>

        <dependency>
            <groupId>org.odpi.egeria</groupId>
            <artifactId>repository-services-apis</artifactId>
        </dependency>

        <dependency>
            <groupId>org.odpi.egeria</groupId>
            <artifactId>repository-services-archive-utilities</artifactId>
        </dependency>

        <dependency>
            <groupId>org.odpi.egeria</groupId>
            <artifactId>open-metadata-types</artifactId>
        </dependency>

        <dependency>
            <groupId>org.odpi.egeria</groupId>
            <artifactId>catalog-builder</artifactId>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Logback used as provider for slf4j logging -->
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>compile</scope>
        </dependency>

        <!-- Libraries for the connectors -->
        <dependency>
            <groupId>org.odpi.egeria</groupId>
            <artifactId>open-connector-framework</artifactId>
        </dependency>
        <dependency>
            <groupId>org.odpi.egeria</groupId>
            <artifactId>avro-file-connector</artifactId>
        </dependency>
        <dependency>
            <groupId>org.odpi.egeria</groupId>
            <artifactId>basic-file-connector</artifactId>
        </dependency>
        <dependency>
            <groupId>org.odpi.egeria</groupId>
            <artifactId>csv-file-connector</artifactId>
        </dependency>
        <dependency>
            <groupId>org.odpi.egeria</groupId>
            <artifactId>data-folder-connector</artifactId>
        </dependency>
        <dependency>
            <groupId>org.odpi.egeria</groupId>
            <artifactId>kafka-open-metadata-topic-connector</artifactId>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>buildarchive</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <!-- Need to create ant property to pass from maven to ant task -->
                                <!-- generating code here -->
                                <property name="antDirectory" value="${project.build.directory}"/>
                                <java classname="org.odpi.openmetadata.archiveutilities.openconnectors.datastoreconnectors.DataStoreConnectorsArchiveWriter"
                                      dir="${antDirectory}" fork="true">
                                    <classpath>
                                        <path refid="maven.compile.classpath"/>
                                        <path refid="maven.plugin.classpath"/>
                                    </classpath>
                                </java>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>assemble-all</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <descriptorRefs>
                                <descriptorRef>jar-with-dependencies</descriptorRef>
                            </descriptorRefs>
                            <archive>
                                <manifest>
                                    <mainClass>org.odpi.openmetadata.archiveutilities.openconnectors.datastoreconnectors.DataStoreConnectorsArchiveWriter</mainClass>
                                </manifest>
                            </archive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
