<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.frankframework</groupId>
    <artifactId>frankframework-console</artifactId>
    <version>8.1.1</version>
  </parent>
  <artifactId>frankframework-console-frontend</artifactId>
  <version>8.1.1</version>
  <name>Frank Console Frontend</name>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Niels Meijer</name>
      <email>niels@frankframework.org</email>
      <organization>Frank!Framework</organization>
      <organizationUrl>https://frankframework.org</organizationUrl>
    </developer>
    <developer>
      <name>Vivy Booman</name>
      <email>vivy@frankframework.org</email>
      <organization>Frank!Framework</organization>
      <organizationUrl>https://frankframework.org</organizationUrl>
    </developer>
    <developer>
      <name>Sergi Philipsen</name>
      <email>sergi@frankframework.org</email>
      <organization>Frank!Framework</organization>
      <organizationUrl>https://frankframework.org</organizationUrl>
    </developer>
  </developers>
  <properties>
    <frontend.source.location>${project.basedir}/src/main/frontend</frontend.source.location>
    <frontend.target.location>${project.build.directory}/frontend</frontend.target.location>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.frankframework</groupId>
      <artifactId>frankframework-commons</artifactId>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <build>
    <defaultGoal>generate-resources</defaultGoal>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                    <versionRange>[1.12,)</versionRange>
                    <goals>
                      <goal>install-node-and-npm</goal>
                      <goal>npm</goal>
                      <goal>npx</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>com.github.hazendaz.maven</groupId>
                    <artifactId>directory-maven-plugin</artifactId>
                    <versionRange>[1,)</versionRange>
                    <goals>
                      <goal>directory-of</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
        <plugin>
          <groupId>com.github.eirslett</groupId>
          <artifactId>frontend-maven-plugin</artifactId>
          <version>1.15.0</version>
          <configuration>
            <nodeVersion>v20.11.1</nodeVersion>
            <workingDirectory>${frontend.source.location}</workingDirectory>
            <installDirectory>${project.build.directory}</installDirectory>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.glassfish.copyright</groupId>
          <artifactId>glassfish-copyright-maven-plugin</artifactId>
          <executions>
            <execution>
              <id>Check-CopyRight-Notice</id>
              <configuration>
                <skip>true</skip>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <executions>
            <execution>
              <id>verify-code-style</id>
              <configuration>
                <skip>true</skip>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-enforcer-plugin</artifactId>
          <executions>
            <execution>
              <id>enforce-lib-ban</id>
              <configuration>
                <skip>true</skip>
              </configuration>
            </execution>
            <execution>
              <id>enforce-classpath-lib-ban</id>
              <configuration>
                <skip>true</skip>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>install node and npm</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>install-node-and-npm</goal>
            </goals>
          </execution>
          <execution>
            <id>npm install</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>npm</goal>
            </goals>
            <configuration>
              <arguments>install</arguments>
            </configuration>
          </execution>
          <execution>
            <id>npm build</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>npx</goal>
            </goals>
            <configuration>
              <arguments>ng build -c development</arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.3.1</version>
        <executions>
          <execution>
            <id>copy NPM dist to Maven build folder</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/console</outputDirectory>
              <resources>
                <resource>
                  <directory>${frontend.target.location}</directory>
                  <filtering>false</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <reporting>
    <plugins>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${javadoc-plugin.version}</version>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
    </plugins>
  </reporting>
  <profiles>
    <profile>
      <id>ci</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>3.2.0</version>
            <executions>
              <execution>
                <id>npm install</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
                <configuration>
                  <executable>npm</executable>
                  <arguments>
                    <argument>install</argument>
                  </arguments>
                </configuration>
              </execution>
              <execution>
                <id>ng build</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
                <configuration>
                  <executable>npx</executable>
                  <arguments>
                    <argument>ng</argument>
                    <argument>build</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <workingDirectory>${frontend.source.location}</workingDirectory>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
