<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <artifactId>eci-elements</artifactId>
        <groupId>dev.getelements.elements</groupId>
        <version>3.2.0</version>
    </parent>

    <artifactId>web-ui-angular-jetty</artifactId>
    <version>3.2.0</version>

    <dependencies>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-deploy</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty.ee10</groupId>
            <artifactId>jetty-ee10-servlet</artifactId>
        </dependency>
        <dependency>
            <groupId>dev.getelements.elements</groupId>
            <artifactId>common-servlet</artifactId>
        </dependency>
        <dependency>
            <groupId>dev.getelements.elements</groupId>
            <artifactId>common-jetty</artifactId>
        </dependency>
        <dependency>
            <groupId>dev.getelements.elements</groupId>
            <artifactId>common-servlet-guice</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.6.0</version>
                <executions>
                    <execution>
                        <id>exec-npm-install</id>
                        <phase>generate-sources</phase>
                        <configuration>
                            <workingDirectory>${project.basedir}/elements-web-ui</workingDirectory>
                            <executable>npm</executable>
                            <arguments>
                                <argument>ci</argument>
                                <argument>--legacy-peer-deps</argument>
                            </arguments>
                        </configuration>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>exec-npm-ng-build</id>
                        <phase>generate-sources</phase>
                        <configuration>
                            <workingDirectory>${project.basedir}/elements-web-ui</workingDirectory>
                            <executable>ng</executable>
                            <arguments>
                                <argument>build</argument>
                                <argument>--output-path</argument>
                                <argument>${project.build.outputDirectory}/dev/getelements/elements/webui/angular</argument>
                                <argument>--configuration</argument>
                                <argument>production</argument>
                                <argument>--base-href</argument>
                                <argument>/</argument>
                            </arguments>
                            <environmentVariables>
                                <NODE_OPTIONS>--openssl-legacy-provider</NODE_OPTIONS>
                            </environmentVariables>
                        </configuration>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

