<?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">
  <parent>
    <artifactId>flink-parent</artifactId>
    <groupId>org.apache.flink</groupId>
    <version>1.16.0</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>flink-runtime-web</artifactId>
  <name>Flink : Runtime web</name>
  <build>
    <resources>
      <resource>
        <directory>web-dashboard</directory>
        <includes>
          <include>web/**</include>
        </includes>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>test-program-jar</id>
            <phase>process-test-classes</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <includes>
                <include>org/apache/flink/runtime/webmonitor/handlers/utils/TestProgram.java</include>
              </includes>
              <archive>
                <manifest>
                  <mainClass>org.apache.flink.runtime.webmonitor.handlers.utils.TestProgram</mainClass>
                </manifest>
              </archive>
              <finalName>test-program</finalName>
            </configuration>
          </execution>
          <execution>
            <id>test-parameter-program-jar</id>
            <phase>process-test-classes</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <includes>
                <include>org/apache/flink/runtime/webmonitor/handlers/utils/TestProgram.java</include>
              </includes>
              <archive>
                <manifest>
                  <mainClass>org.apache.flink.runtime.webmonitor.testutils.ParameterProgram</mainClass>
                </manifest>
              </archive>
              <finalName>${test.parameterProgram.name}</finalName>
            </configuration>
          </execution>
          <execution>
            <id>test-parameter-program-jar-with-eager-sink</id>
            <phase>process-test-classes</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <includes>
                <include>org/apache/flink/runtime/webmonitor/handlers/utils/EagerSinkProgram.java</include>
              </includes>
              <archive>
                <manifest>
                  <mainClass>org.apache.flink.runtime.webmonitor.handlers.utils.EagerSinkProgram</mainClass>
                </manifest>
              </archive>
              <finalName>${test.ParameterProgramWithEagerSink.name}</finalName>
            </configuration>
          </execution>
          <execution>
            <id>test-parameter-program-jar-without-manifest</id>
            <phase>process-test-classes</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <includes>
                <include>org/apache/flink/runtime/webmonitor/handlers/utils/TestProgram.java</include>
              </includes>
              <finalName>${test.ParameterProgramNoManifest.name}</finalName>
            </configuration>
          </execution>
          <execution>
            <id>test-output-program-jar</id>
            <phase>process-test-classes</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <includes>
                <include>org/apache/flink/runtime/webmonitor/handlers/utils/OutputTestProgram.java</include>
              </includes>
              <archive>
                <manifest>
                  <mainClass>org.apache.flink.runtime.webmonitor.handlers.utils.OutputTestProgram</mainClass>
                </manifest>
              </archive>
              <finalName>output-test-program</finalName>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <version>1.11.0</version>
        <executions>
          <execution>
            <id>install node and npm</id>
            <goals>
              <goal>install-node-and-npm</goal>
            </goals>
            <configuration>
              <nodeVersion>v16.13.2</nodeVersion>
              <npmVersion>8.1.2</npmVersion>
            </configuration>
          </execution>
          <execution>
            <id>npm install</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <configuration>
              <arguments>ci --cache-max=0 --no-save ${npm.proxy}</arguments>
              <environmentVariables>
                <HUSKY_SKIP_INSTALL>true</HUSKY_SKIP_INSTALL>
              </environmentVariables>
            </configuration>
          </execution>
          <execution>
            <id>npm run ci-check</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <configuration>
              <arguments>run ci-check</arguments>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <workingDirectory>web-dashboard</workingDirectory>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemPropertyVariables>
            <targetDir>${project.build.directory}</targetDir>
            <parameterJarName>${test.parameterProgram.name}</parameterJarName>
            <parameterJarWithoutManifestName>${test.ParameterProgramNoManifest.name}</parameterJarWithoutManifestName>
            <parameterJarWithEagerSinkName>${test.ParameterProgramWithEagerSink.name}</parameterJarWithEagerSinkName>
          </systemPropertyVariables>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>skip-webui-build</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>com.github.eirslett</groupId>
              <artifactId>frontend-maven-plugin</artifactId>
              <configuration>
                <skip>true</skip>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
    <profile>
      <id>use-alibaba-mirror</id>
      <properties>
        <npm.proxy>--registry http://172.17.0.1:8888/repository/npm/</npm.proxy>
      </properties>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-runtime</artifactId>
      <version>1.16.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-clients</artifactId>
      <version>1.16.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-shaded-netty</artifactId>
      <version>4.1.70.Final-15.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-shaded-guava</artifactId>
      <version>30.1.1-jre-15.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-shaded-jackson</artifactId>
      <version>2.12.4-15.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-test-utils-junit</artifactId>
      <version>1.16.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>testcontainers</artifactId>
          <groupId>org.testcontainers</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-test-utils</artifactId>
      <version>1.16.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>flink-table-common</artifactId>
          <groupId>org.apache.flink</groupId>
        </exclusion>
        <exclusion>
          <artifactId>flink-runtime</artifactId>
          <groupId>org.apache.flink</groupId>
        </exclusion>
        <exclusion>
          <artifactId>flink-core</artifactId>
          <groupId>org.apache.flink</groupId>
        </exclusion>
        <exclusion>
          <artifactId>flink-rpc-akka-loader</artifactId>
          <groupId>org.apache.flink</groupId>
        </exclusion>
        <exclusion>
          <artifactId>flink-statebackend-changelog</artifactId>
          <groupId>org.apache.flink</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-shaded-jackson-module-jsonSchema</artifactId>
      <version>2.12.4-15.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.11.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.32</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>1.3.9</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>5.8.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit-jupiter-api</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-jupiter-params</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-jupiter-engine</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.junit.vintage</groupId>
      <artifactId>junit-vintage-engine</artifactId>
      <version>5.8.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit-platform-engine</artifactId>
          <groupId>org.junit.platform</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit</artifactId>
          <groupId>junit</groupId>
        </exclusion>
        <exclusion>
          <artifactId>apiguardian-api</artifactId>
          <groupId>org.apiguardian</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.23.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>byte-buddy</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-inline</artifactId>
      <version>3.4.6</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>3.4.6</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>byte-buddy-agent</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>byte-buddy</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-module-junit4</artifactId>
      <version>2.0.9</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>powermock-module-junit4-common</artifactId>
          <groupId>org.powermock</groupId>
        </exclusion>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit</artifactId>
          <groupId>junit</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-api-mockito2</artifactId>
      <version>2.0.9</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>mockito-core</artifactId>
          <groupId>org.mockito</groupId>
        </exclusion>
        <exclusion>
          <artifactId>powermock-api-support</artifactId>
          <groupId>org.powermock</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
      <version>1.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>1.17.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>testcontainers</artifactId>
          <groupId>org.testcontainers</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-jupiter-api</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j-impl</artifactId>
      <version>2.17.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-api</artifactId>
      <version>2.17.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <version>2.17.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-1.2-api</artifactId>
      <version>2.17.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <properties>
    <test.parameterProgram.name>parameter-program</test.parameterProgram.name>
    <test.ParameterProgramWithEagerSink.name>parameter-program-with-eager-sink</test.ParameterProgramWithEagerSink.name>
    <test.ParameterProgramNoManifest.name>parameter-program-without-manifest</test.ParameterProgramNoManifest.name>
  </properties>
</project>
