<?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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.vaadin</groupId>
    <artifactId>flow-project</artifactId>
    <version>25.4.sse2-SNAPSHOT</version>
  </parent>
  <artifactId>vaadin-dev-server</artifactId>
  <packaging>jar</packaging>
  <name>Vaadin Development Mode Server</name>
  <description>${project.name}</description>

  <properties>
    <surefire.argLine>--add-opens=java.base/java.net=ALL-UNNAMED</surefire.argLine>
    <!-- Allows to skip running NPM tests via exec-maven-plugin with both -Dmaven.test.skip=true and -DskipTests=true -->
    <maven.test.skip>false</maven.test.skip>
    <skipTests>${maven.test.skip}</skipTests>
    <flow.apicmp.skip>true</flow.apicmp.skip>
  </properties>

  <dependencies>

    <!-- Project dependencies -->

    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>flow-server</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>flow-build-tools</artifactId>
      <version>${project.version}</version>
      <classifier>shaded</classifier>
    </dependency>
    <!-- The dev-loop daemon. Not used from this module's code: it is here so
         that it travels the route this module already travels - in through the
         optional com.vaadin:vaadin-dev dependency a starter declares, and out of
         a production build by the same mechanism that excludes the dev server.
         The vaadin-dev CLI then resolves the jar from the project's own
         dependencies rather than having anything staged into the project. -->
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>flow-devloop-daemon</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>license-checker</artifactId>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>open</artifactId>
      <version>8.5.0.5</version>
    </dependency>

    <dependency>
      <groupId>com.github.javaparser</groupId>
      <artifactId>javaparser-core</artifactId>
      <version>3.28.2</version>
    </dependency>
    <dependency>
      <groupId>io.methvin</groupId>
      <artifactId>directory-watcher</artifactId>
      <version>0.19.1</version>
    </dependency>
    <!-- Needed for security annotations -->
    <dependency>
      <groupId>jakarta.annotation</groupId>
      <artifactId>jakarta.annotation-api</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- API dependencies -->

    <dependency>
      <groupId>jakarta.servlet</groupId>
      <artifactId>jakarta.servlet-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.websocket</groupId>
      <artifactId>jakarta.websocket-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.websocket</groupId>
      <artifactId>jakarta.websocket-client-api</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- Test dependencies -->
    <dependency>
      <groupId>jakarta.platform</groupId>
      <artifactId>jakarta.jakartaee-web-api</artifactId>
      <version>${jakarta.ee.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>flow-test-util</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>flow-server</artifactId>
      <version>${project.version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <configuration>
          <typescript>
            <excludes>
              <exclude>src/main/resources/META-INF/frontend/vaadin-dev-tools//**</exclude>
            </excludes>
          </typescript>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestEntries>
              <Dependencies>jdk.unsupported</Dependencies>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>3.6.3</version>
        <executions>
          <execution>
            <id>npm-install</id>
            <goals>
              <goal>exec</goal>
            </goals>
            <phase>generate-resources</phase>
            <configuration>
              <executable>npm</executable>
              <arguments>
                <argument>install</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>npm-build</id>
            <goals>
              <goal>exec</goal>
            </goals>
            <phase>generate-resources</phase>
            <configuration>
              <executable>npm</executable>
              <arguments>
                <argument>run</argument>
                <argument>build</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
