<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright 2020 Goldman Sachs

 Licensed 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">
    <parent>
        <groupId>org.finos.legend.engine</groupId>
        <artifactId>legend-engine-pure-ide</artifactId>
        <version>4.129.15</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>legend-engine-pure-ide-light-http-server</artifactId>
    <name>Legend Engine - Pure IDE Light - HTTP - Server</name>

    <properties>
        <skip.yarn>false</skip.yarn>
        <pure-ide.web-application.version>${legend.web-application.version}</pure-ide.web-application.version>
        <pure-ide.web-application.url>${npm.registry.url}/@finos/legend-application-pure-ide-deployment/-/legend-application-pure-ide-deployment-${pure-ide.web-application.version}.tgz</pure-ide.web-application.url>
    </properties>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>com.googlecode.maven-download-plugin</groupId>
                <artifactId>download-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>download-web-content</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <skip>${skip.yarn}</skip>
                    <url>${pure-ide.web-application.url}</url>
                    <unpack>true</unpack>
                    <outputDirectory>${project.build.directory}/web-content</outputDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <!-- Skip default resources -->
                        <id>default-resources</id>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </execution>
                    <execution>
                        <!-- Skip default test resources -->
                        <id>default-testResources</id>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-web-content</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/classes/web</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.build.directory}/web-content/package/dist</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- PURE -->
        <dependency>
            <groupId>org.finos.legend.pure</groupId>
            <artifactId>legend-pure-m4</artifactId>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.pure</groupId>
            <artifactId>legend-pure-m3-core</artifactId>
        </dependency>
        <!-- PURE -->

        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-ide-light-pure</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-ide-light-interpreted-functions</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-server-http-server</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-runtime-java-extension-interpreted-functions-standard</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-runtime-java-extension-interpreted-functions-unclassified</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-runtime-java-extension-interpreted-functions-json</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.pure</groupId>
            <artifactId>legend-pure-runtime-java-extension-interpreted-store-relational</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-runtime-java-extension-interpreted-functions-relationalStore-PCT</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-relationalStore-h2-execution-2.1.214</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-relationalStore-h2-PCT</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-relationalStore-clickhouse-PCT</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-relationalStore-duckdb-PCT</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-relationalStore-postgres-PCT</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-relationalStore-oracle-PCT</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-relationalStore-snowflake-PCT</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-relationalStore-trino-PCT</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-relationalStore-memsql-PCT</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-relationalStore-sqlserver-PCT</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-runtime-java-extension-compiled-functions-pureExtensions</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-runtime-java-extension-interpreted-functions-relation</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.pure</groupId>
            <artifactId>legend-pure-runtime-java-extension-interpreted-dsl-tds</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.pure</groupId>
            <artifactId>legend-pure-m2-dsl-diagram-grammar</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.pure</groupId>
            <artifactId>legend-pure-m2-dsl-mapping-grammar</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-functions-json-pure</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.pure</groupId>
            <artifactId>legend-pure-m2-store-relational-pure</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.pure</groupId>
            <artifactId>legend-pure-runtime-java-engine-interpreted</artifactId>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-runtime-java-extension-shared-functions-json</artifactId>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.pure</groupId>
            <artifactId>legend-pure-runtime-java-engine-shared</artifactId>
        </dependency>

        <!-- Engine extensions -->
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-functions-planExecution-pure</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-runtime-java-extension-interpreted-functions-planExecution</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-functions-pureExtensions-pure</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-runtime-java-extension-interpreted-functions-pureExtensions</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-runtime-java-extension-interpreted-functions-legendCompiler</artifactId>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-runtime-java-extension-interpreted-functions-javaCompiler</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-runtime-java-extension-compiled-functions-javaCompiler</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-dataquality-grammar</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-extensions-collection-generation</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-extensions-collection-execution</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-tds-compiler</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-dataquality-pure-test</artifactId>
            <scope>runtime</scope>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-elasticsearch-executionPlan-test</artifactId>
            <scope>runtime</scope>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-relationalStore-SDT-pure</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-relationalStore-postgresSqlParser-functions-interpreted</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-python-functions-execution-runtime-java-extension-interpreted</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-python-functions-execution-runtime-java-extension-compiled</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-pure-code-reversePCT-pure</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-deephaven-executionPlan-test</artifactId>
            <scope>runtime</scope>
        </dependency>
        <!-- Engine extensions -->

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>

        <dependency>
            <groupId>org.eclipse.collections</groupId>
            <artifactId>eclipse-collections</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.collections</groupId>
            <artifactId>eclipse-collections-api</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
        </dependency>

        <!-- DropWizard -->
        <dependency>
            <groupId>io.dropwizard</groupId>
            <artifactId>dropwizard-core</artifactId>
        </dependency>
        <dependency>
            <groupId>io.dropwizard</groupId>
            <artifactId>dropwizard-jetty</artifactId>
        </dependency>
        <dependency>
            <groupId>io.dropwizard</groupId>
            <artifactId>dropwizard-jersey</artifactId>
        </dependency>
        <dependency>
            <groupId>io.dropwizard</groupId>
            <artifactId>dropwizard-assets</artifactId>
        </dependency>
        <dependency>
            <groupId>io.dropwizard</groupId>
            <artifactId>dropwizard-configuration</artifactId>
        </dependency>
        <!-- DropWizard -->

        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-servlets</artifactId>
        </dependency>

        <!-- Swagger -->
        <dependency>
            <groupId>com.smoketurner</groupId>
            <artifactId>dropwizard-swagger</artifactId>
        </dependency>
        <!-- Swagger -->

        <!-- Servlet -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <!-- Servlet -->

        <!-- ANNOTATIONS -->
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
        </dependency>
        <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-annotations</artifactId>
        </dependency>
        <!-- ANNOTATIONS -->

        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-test-server-shared</artifactId>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-xt-relationalStore-executionPlan</artifactId>
        </dependency>
        <dependency>
            <groupId>org.finos.legend.engine</groupId>
            <artifactId>legend-engine-server-http-server</artifactId>
            <type>test-jar</type>
            <version>${project.version}</version>
        </dependency>

    </dependencies>

    <profiles>
        <profile>
            <id>docker</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.spotify</groupId>
                        <artifactId>dockerfile-maven-plugin</artifactId>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>build</goal>
                                    <goal>tag</goal>
                                    <goal>push</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <tag>${project.version}</tag>
                            <username>${env.DOCKER_USERNAME}</username>
                            <password>${env.DOCKER_PASSWORD}</password>
                            <repository>registry.hub.docker.com/${env.DOCKER_USERNAME}/${project.artifactId}</repository>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>docker-snapshot</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.spotify</groupId>
                        <artifactId>dockerfile-maven-plugin</artifactId>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <phase>install</phase>
                                <goals>
                                    <goal>build</goal>
                                    <goal>tag</goal>
                                    <goal>push</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <tag>snapshot</tag>
                            <username>${env.DOCKER_USERNAME}</username>
                            <password>${env.DOCKER_PASSWORD}</password>
                            <repository>registry.hub.docker.com/${env.DOCKER_USERNAME}/${project.artifactId}</repository>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
