<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <artifactId>zeppelin</artifactId>
        <groupId>org.apache.zeppelin</groupId>
        <version>0.12.1</version>
    </parent>

    <artifactId>zengine-plugins-parent</artifactId>
    <packaging>pom</packaging>
    <name>Zeppelin: Plugins Parent</name>
    <description>Zeppelin Plugins Parent</description>
    <properties>
        <!-- no need to include hadoop jar, because it's already included in zeppelin-zengine -->
        <hadoop.deps.scope>provided</hadoop.deps.scope>
    </properties>

    <modules>
        <module>notebookrepo/s3</module>
        <module>notebookrepo/github</module>
        <module>notebookrepo/azure</module>
        <module>notebookrepo/gcs</module>
        <module>notebookrepo/filesystem</module>
        <module>notebookrepo/mongo</module>
        <module>notebookrepo/oss</module>

        <module>launcher/k8s-standard</module>
        <module>launcher/docker</module>
        <module>launcher/yarn</module>
        <module>launcher/flink</module>
    </modules>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>zeppelin-zengine</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
            <exclusions>
                <!-- jcl-over-slf4j is provided by zeppelin-interprerter -->
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Test libraries -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>copy-plugin-dependencies</id>
                            <phase>package</phase>
                            <goals>
                                <goal>copy-dependencies</goal>
                            </goals>
                            <configuration>
                                <outputDirectory>${project.basedir}/../../../plugins/${plugin.name}</outputDirectory>
                                <overWriteReleases>false</overWriteReleases>
                                <overWriteSnapshots>false</overWriteSnapshots>
                                <overWriteIfNewer>true</overWriteIfNewer>
                                <includeScope>runtime</includeScope>
                            </configuration>
                        </execution>
                        <execution>
                            <id>copy-plugin-artifact</id>
                            <phase>package</phase>
                            <goals>
                                <goal>copy</goal>
                            </goals>
                            <configuration>
                                <outputDirectory>${project.basedir}/../../../plugins/${plugin.name}</outputDirectory>
                                <overWriteReleases>false</overWriteReleases>
                                <overWriteSnapshots>false</overWriteSnapshots>
                                <overWriteIfNewer>true</overWriteIfNewer>
                                <artifactItems>
                                    <artifactItem>
                                        <groupId>${project.groupId}</groupId>
                                        <artifactId>${project.artifactId}</artifactId>
                                        <version>${project.version}</version>
                                        <type>${project.packaging}</type>
                                    </artifactItem>
                                </artifactItems>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>delete-plugin-dir</id>
                            <goals>
                                <goal>clean</goal>
                            </goals>
                            <phase>clean</phase>
                            <configuration>
                                <filesets>
                                    <fileset>
                                        <directory>${project.basedir}/../../../plugins/${plugin.name}</directory>
                                        <followSymlinks>true</followSymlinks>
                                        <useDefaultExcludes>false</useDefaultExcludes>
                                    </fileset>
                                </filesets>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
