<?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>vaadin-parent</artifactId>
    <version>3.0.3</version>
  </parent>

  <artifactId>flow-project</artifactId>
  <version>25.5.web-notification-api-SNAPSHOT</version>
  <packaging>pom</packaging>
  <name>Flow</name>
  <url>https://vaadin.com/flow</url>
  <inceptionYear>2000</inceptionYear>

  <organization>
    <name>Vaadin Ltd</name>
    <url>https://vaadin.com</url>
  </organization>
  <licenses>
    <license>
      <name>Apache License Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <modules>
    <module>flow</module>
    <module>flow-build-tools</module>
    <module>flow-server</module>
    <module>flow-react</module>
    <module>flow-polymer-template</module>
    <module>flow-lit-template</module>
    <module>flow-push</module>
    <module>flow-webpush</module>
    <module>flow-data</module>
    <module>flow-client</module>
    <module>flow-html-components</module>
    <module>flow-html-components-testbench</module>
    <module>flow-dnd</module>
    <module>flow-test-util</module>
    <module>flow-server-production-mode</module>
    <module>flow-plugins</module>
    <module>flow-test-generic</module>
    <module>flow-bom</module>
    <module>flow-devloop-daemon</module>
    <module>vaadin-dev-server</module>
    <module>vaadin-spring</module>
    <module>vaadin-cdi</module>
    <module>vaadin-quarkus</module>
    <module>flow-polymer2lit</module>
  </modules>
  <scm>
    <connection>scm:https:https://github.com/vaadin/flow.git</connection>
    <developerConnection>scm:git:git@github.com:vaadin/flow.git</developerConnection>
    <url>https://github.com/vaadin/flow</url>
  </scm>

  <properties>
    <flow.release.repo.id>vaadin-prereleases</flow.release.repo.id>
    <flow.release.repo.url>https://maven.vaadin.com/vaadin-prereleases/</flow.release.repo.url>

    <flow.addons.repo.id>vaadin-addons</flow.addons.repo.id>
    <flow.addons.repo.url>https://maven.vaadin.com/vaadin-addons</flow.addons.repo.url>

    <maven.compiler.release>21</maven.compiler.release>
    <maven.compiler.source>${maven.compiler.release}</maven.compiler.source>
    <maven.compiler.target>${maven.compiler.release}</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <sonar.java.source>21</sonar.java.source>
    <sonar.issuesReport.console.enable>true</sonar.issuesReport.console.enable>
    <sonar.issuesReport.html.enable>true</sonar.issuesReport.html.enable>

    <!--
      The agentic workflow lock files are generated by `gh aw compile` and
      install their agent with a global npm install. S6505 asks for the
      ignore-scripts flag on those, which the Claude engine cannot use:
      @anthropic-ai/claude-code downloads its native binary from a
      postinstall script, and skipping it leaves a CLI that exits with
      "claude native binary not installed". The flag is also not ours to
      add, since editing a generated file is undone by the next compile.
      Scoped to this one rule, so the lock files keep being analyzed for
      everything else.
    -->
    <!--
      DependentProvider serializes the CreationalContext it holds. S2118 flags
      that because the declared type is not Serializable, but the instances a
      CDI container actually supplies are - Weld's CreationalContextImpl among
      them - and the class round-trips fine on the containers the CDI suite
      deploys to. Writing it is deliberate: without it a deserialized provider
      could not destroy its @Dependent instance. Scoped to this one rule in
      this one file.
    -->
    <sonar.issue.ignore.multicriteria>agenticInstallScripts,cdiDependentProviderSerialization</sonar.issue.ignore.multicriteria>
    <sonar.issue.ignore.multicriteria.agenticInstallScripts.ruleKey>githubactions:S6505</sonar.issue.ignore.multicriteria.agenticInstallScripts.ruleKey>
    <sonar.issue.ignore.multicriteria.agenticInstallScripts.resourceKey>**/.github/workflows/*.lock.yml</sonar.issue.ignore.multicriteria.agenticInstallScripts.resourceKey>
    <sonar.issue.ignore.multicriteria.cdiDependentProviderSerialization.ruleKey>java:S2118</sonar.issue.ignore.multicriteria.cdiDependentProviderSerialization.ruleKey>
    <sonar.issue.ignore.multicriteria.cdiDependentProviderSerialization.resourceKey>**/com/vaadin/cdi/util/DependentProvider.java</sonar.issue.ignore.multicriteria.cdiDependentProviderSerialization.resourceKey>

    <maven.javadoc.skip>true</maven.javadoc.skip>
    <failOnMissingWebXml>false</failOnMissingWebXml>

    <!--
      Ensures modules that do not declare this POM as parent
      (like flow-bom) are updated as well when using versions:set
      to change the project version
    -->
    <processAllModules>true</processAllModules>

    <!-- Dependencies -->
    <spring.boot.version>4.2.0</spring.boot.version>
    <jakarta.ee.version>11.0.0</jakarta.ee.version>
    <hibernate.validator.version>9.2.0.Final</hibernate.validator.version>
    <slf4j.version>2.0.20</slf4j.version>
    <polymer.version>2.6.1</polymer.version>
    <jackson.version>3.1.8</jackson.version>
    <jaxb.version>4.0.9</jaxb.version>
    <guava.version>33.8.0-jre</guava.version>
    <junit.jupiter.version>6.1.3</junit.jupiter.version>
    <weld.version>6.0.4.Final</weld.version>
    <weld.junit.version>5.0.3.Final</weld.junit.version>
    <quarkus.version>3.33.0</quarkus.version>

    <!-- Plugins -->
    <frontend.maven.plugin.version>1.5</frontend.maven.plugin.version>
    <maven.surefire.plugin.version>3.6.1</maven.surefire.plugin.version>
    <jacoco.plugin.version>0.8.16</jacoco.plugin.version>
    <maven.failsafe.plugin.version>3.5.6</maven.failsafe.plugin.version>
    <maven.war.plugin.version>3.5.1</maven.war.plugin.version>
    <maven.jar.plugin.version>3.5.1</maven.jar.plugin.version>
    <maven.resources.plugin.version>3.0.2</maven.resources.plugin.version>
    <maven.clean.plugin.version>3.5.0</maven.clean.plugin.version>
    <maven.exec.plugin.version>3.7.0</maven.exec.plugin.version>
    <!-- Maven 3.8 still binds install:2.4 by default, which corrupts local
         repository metadata when modules install in parallel (-T). -->
    <maven.install.plugin.version>3.2.0</maven.install.plugin.version>
    <testbench.version>25.4.0-beta2</testbench.version>
    <jetty.version>12.1.15</jetty.version>
    <properties-maven-plugin.version>1.4.0</properties-maven-plugin.version>
    <build-helper-maven-plugin.version>3.8.0</build-helper-maven-plugin.version>
    <maven.version>3.10.2</maven.version>
    <maven-plugin-annotations.version>3.16.0</maven-plugin-annotations.version>
    <jandex.plugin.version>3.6.1</jandex.plugin.version>
    <!-- The Jandex index format that the plugin writes, set apart from the
         plugin version. Quarkus reads the indexes with the Jandex its BOM
         manages, and an older Jandex rejects a newer format. So this is the
         newest format that the Jandex of the Quarkus BOM at quarkus.version
         reads. A newer Quarkus reads it too, since Jandex reads older
         formats. -->
    <jandex.format.version>13</jandex.format.version>
    <!-- Modules with no Jandex consumer (tooling, tests, the Spring and CDI
         integrations) set this to true -->
    <jandex.skip>false</jandex.skip>
    <spotless.plugin.version>3.12.0</spotless.plugin.version>
    <spotless.license-header>${maven.multiModuleProjectDirectory}/eclipse/apache2-license-header.txt</spotless.license-header>
    <spotless.ratchetFrom/>
    <spotless.prettier.version>3.9.9</spotless.prettier.version>

    <!-- Frontend -->
    <flow.dev.dependencies.folder>generatedDeps</flow.dev.dependencies.folder>
    <flow.dev.dependencies.file>devDependencies.json</flow.dev.dependencies.file>

    <!-- Used in OSGi manifests -->
    <jsoup.version>1.24.1</jsoup.version>
    <!-- Note that this should be kept in sync with the class Constants -->
    <atmosphere.runtime.version>3.0.5.slf4jvaadin1</atmosphere.runtime.version>
    <atmosphere.client.version>4.0.3</atmosphere.client.version>

    <!-- JPMS: stable module name, written as Automatic-Module-Name by the
         maven-jar-plugin configuration. A module that publishes a runtime
         jar sets it following the naming rule in CONVENTIONS.md (Build &
         Dependencies). Empty means no entry. -->
    <jpms.module.name/>

    <forbiddenapis.version>3.11</forbiddenapis.version>

    <!-- OSGi -->
    <!-- Note: the parserVersion value is set by build-helper-maven-plugin -->
    <osgi.bundle.version>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}</osgi.bundle.version>
    <bnd.version>7.5.0</bnd.version>
    <osgi.core.version>7.0.0</osgi.core.version>
    <osgi.compendium.version>7.0.0</osgi.compendium.version>
    <osgi.annotation.version>8.1.0</osgi.annotation.version>

    <maven.test.skip>false</maven.test.skip>

    <!-- This property is needed to allow some Win-specific unit tests -->
    <!-- to be disabled via system property in CI until they got fixed -->
    <exclude.windows.failed.tests/>

    <!-- Extra JVM arguments for surefire forks; modules override this
         when their tests need e.g. add-opens flags. The empty default
         keeps the argLine expression resolvable everywhere. -->
    <surefire.argLine/>
    <!-- Populated by jacoco:prepare-agent when the coverage profile is
         active. Late-bound into the surefire argLine via @{...} so the
         agent set at execution time is picked up. -->
    <jacoco.agent.argLine/>

    <!-- Keep what passing unit tests print out of the build log, see
         QuietTestOutputListener. Set to false to see everything again.
         Only ever passed to Surefire: the capture replaces the JVM wide
         System.out and System.err, so it must not be used for the tests that
         Failsafe runs in parallel. -->
    <vaadin.test.quietOutput>true</vaadin.test.quietOutput>

    <!-- Skip these categories in validation, use -Pslow-tests to run them.
            Both excludedGroups and the slow-tests profile read
            slowTestGroups. scripts/computeMatrix.js reads it from this pom
            and flow-tests/pom.xml only, so override it there to add
            categories the Slow Tests job runs -->
    <slowTestGroups>com.vaadin.flow.testcategory.SlowTests</slowTestGroups>
    <excludedGroups>${slowTestGroups}</excludedGroups>
    <failsafe.parallel>all</failsafe.parallel>
    <failsafe.threadCount>2</failsafe.threadCount>
    <failsafe.perCoreThreadCount>true</failsafe.perCoreThreadCount>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.openjdk.jol</groupId>
        <artifactId>jol-core</artifactId>
        <version>0.17</version>
      </dependency>
      <dependency>
        <groupId>tools.jackson</groupId>
        <artifactId>jackson-bom</artifactId>
        <version>${jackson.version}</version>
        <type>pom</type>
        <!-- Use the latest version -->
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>jakarta.platform</groupId>
        <artifactId>jakarta.jakartaee-bom</artifactId>
        <version>${jakarta.ee.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <!-- Manages every JUnit artifact, including the ones pulled in
           transitively by test libraries such as weld-junit5 -->
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${junit.jupiter.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.22.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.22.0</version>
      </dependency>

      <dependency>
        <groupId>org.jspecify</groupId>
        <artifactId>jspecify</artifactId>
        <version>1.0.1</version>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>

      <dependency>
        <groupId>net.bytebuddy</groupId>
        <artifactId>byte-buddy</artifactId>
        <version>1.18.17</version>
      </dependency>
      <dependency>
        <groupId>org.ow2.asm</groupId>
        <artifactId>asm</artifactId>
        <version>9.11.1</version>
      </dependency>
      <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>license-checker</artifactId>
        <version>3.1.6</version>
      </dependency>

      <!-- Test dependencies -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13.2</version>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>5.24.0</version>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-inline</artifactId>
        <version>5.2.0</version>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-all</artifactId>
        <version>1.3</version>
      </dependency>
      <dependency>
        <groupId>org.awaitility</groupId>
        <artifactId>awaitility</artifactId>
        <version>4.3.0</version>
      </dependency>
      <dependency>
        <groupId>org.lucee</groupId>
        <artifactId>jcip-annotations</artifactId>
        <version>1.0.0</version>
      </dependency>
      <dependency>
        <groupId>org.jboss.weld.se</groupId>
        <artifactId>weld-se-core</artifactId>
        <version>${weld.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jboss.weld</groupId>
        <artifactId>weld-junit5</artifactId>
        <version>${weld.junit.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.vintage</groupId>
      <artifactId>junit-vintage-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-inline</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.lucee</groupId>
      <artifactId>jcip-annotations</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <repositories>
    <!-- The order of definitions matters. Explicitly defining central
            here to make sure it has the highest priority. -->
    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <url>https://repo.maven.apache.org/maven2</url>
    </repository>
    <repository>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <id>${flow.release.repo.id}</id>
      <url>${flow.release.repo.url}</url>
    </repository>
    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>${flow.addons.repo.id}</id>
      <url>${flow.addons.repo.url}</url>
    </repository>
  </repositories>

  <pluginRepositories>
    <!-- The order of definitions matters. Explicitly defining central
            here to make sure it has the highest priority. -->
    <pluginRepository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <url>https://repo.maven.apache.org/maven2</url>
    </pluginRepository>
    <pluginRepository>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <id>${flow.release.repo.id}</id>
      <url>${flow.release.repo.url}</url>
    </pluginRepository>
  </pluginRepositories>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>${build-helper-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>${maven.exec.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.karaf.tooling</groupId>
          <artifactId>karaf-maven-plugin</artifactId>
          <version>4.3.9</version>
          <extensions>true</extensions>
          <executions>
            <execution>
              <id>generate-features-file</id>
              <goals>
                <goal>features-generate-descriptor</goal>
              </goals>
              <phase>generate-resources</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.7.0</version>
          <dependencies>
            <dependency>
              <groupId>de.skuzzle.enforcer</groupId>
              <artifactId>restrict-imports-enforcer-rule</artifactId>
              <version>3.0.2</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <id>check-logging-imports</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <phase>process-sources</phase>
              <configuration>
                <rules>
                  <RestrictImports>
                    <reason>Use SLF4j for logging</reason>
                    <bannedImport>java.util.logging.**</bannedImport>
                    <!-- Does not log, but has to initialize the
                         java.util.logging handlers before tests start
                         capturing System.err. -->
                    <exclusion>com.vaadin.flow.testutil.QuietTestOutputListener</exclusion>
                  </RestrictImports>
                </rules>
              </configuration>
            </execution>
            <execution>
              <id>default-cli</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <rules>
                  <dependencyConvergence>
                    <excludes>
                      <!-- Spring Boot brings in jspecify 1.0.1 while Selenium
                           and JUnit still depend on 1.0.0. The releases differ
                           only in documentation, so the split is harmless.
                           Remove once the transitive dependencies have caught
                           up. -->
                      <exclude>org.jspecify:jspecify</exclude>
                    </excludes>
                  </dependencyConvergence>
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${maven.jar.plugin.version}</version>
          <executions>
            <execution>
              <!-- Only the main jar gets the module name, a test-jar
                   with the same name would clash on the module path -->
              <id>default-jar</id>
              <configuration>
                <archive>
                  <manifestEntries>
                    <!-- Stable JPMS module name for jars used from the
                         module path. Modules publishing a runtime jar set
                         the jpms.module.name property; the entry is
                         omitted when the property is empty. -->
                    <Automatic-Module-Name>${jpms.module.name}</Automatic-Module-Name>
                  </manifestEntries>
                </archive>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>${maven.install.plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <version>${maven.war.plugin.version}</version>
          <configuration>
            <archive>
              <manifestEntries>
                <Implementation-Title>${project.name}</Implementation-Title>
                <Implementation-Version>${project.version}</Implementation-Version>
              </manifestEntries>
            </archive>
            <packagingExcludes>%regex[WEB-INF/lib/flow-build-tools-.*(?&lt;!-shaded)\.jar]</packagingExcludes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven.surefire.plugin.version}</version>
          <configuration>
            <trimStackTrace>false</trimStackTrace>
            <excludes>
              <exclude>${exclude.windows.failed.tests}</exclude>
            </excludes>
            <argLine>@{jacoco.agent.argLine} ${surefire.argLine}</argLine>
            <enableAssertions>true</enableAssertions>
            <classpathDependencyExcludes>
              <classpathDependencyExclude>org.osgi:org.osgi.core</classpathDependencyExclude>
            </classpathDependencyExcludes>
            <!--
                        <parallel>classes</parallel>
                        <threadCount>4</threadCount>
-->
            <failIfNoTests>false</failIfNoTests>
            <systemPropertyVariables>
              <maven.home>${maven.home}</maven.home>
              <vaadin.test.quietOutput>${vaadin.test.quietOutput}</vaadin.test.quietOutput>
            </systemPropertyVariables>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${maven.failsafe.plugin.version}</version>
          <configuration>
            <argLine>${failsafe.argLine}</argLine>
            <trimStackTrace>false</trimStackTrace>
            <enableAssertions>true</enableAssertions>
            <parallel>${failsafe.parallel}</parallel>
            <threadCount>${failsafe.threadCount}</threadCount>
            <perCoreThreadCount>${failsafe.perCoreThreadCount}</perCoreThreadCount>
            <!-- export test server port to integration tests -->
            <systemPropertyVariables>
              <serverPort>${server.port}</serverPort>
            </systemPropertyVariables>
            <excludes>
              <exclude>**/*$*</exclude>
              <exclude>${exclude.it.tests}</exclude>
              <exclude>${exclude.windows.failed.it.tests}</exclude>
            </excludes>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>com.sun.xml.bind</groupId>
              <artifactId>jaxb-impl</artifactId>
              <version>${jaxb.version}</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>com.github.siom79.japicmp</groupId>
          <artifactId>japicmp-maven-plugin</artifactId>
          <dependencies>
            <dependency>
              <groupId>javax.activation</groupId>
              <artifactId>javax.activation-api</artifactId>
              <version>1.2.0</version>
            </dependency>
          </dependencies>
        </plugin>
        <!--This plugin's configuration is used to store Eclipse
                    m2e settings only. It has no influence on the Maven build itself. -->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.commonjava.maven.plugins</groupId>
                    <artifactId>directory-maven-plugin</artifactId>
                    <versionRange>[0.1,)</versionRange>
                    <goals>
                      <goal>highest-basedir</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore/>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <versionRange>[3.2,)</versionRange>
                    <goals>
                      <goal>descriptor</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore/>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <versionRange>[1.7,)</versionRange>
                    <goals>
                      <goal>run</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore/>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>2.9.0</version>
          <configuration>
            <!-- Default is system -->
            <excludedScopes>system,test</excludedScopes>
            <!-- Workaround for https://github.com/mojohaus/license-maven-plugin/issues/511:
                 2.9.0 default AUTODETECT fails on a clean target dir where licenses.xml does not yet exist. -->
            <licensesOutputFileEol>LF</licensesOutputFileEol>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.5.0</version>
          <configuration>
            <propertiesEncoding>UTF-8</propertiesEncoding>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.sonarsource.scanner.maven</groupId>
          <artifactId>sonar-maven-plugin</artifactId>
          <version>5.9.0.7382</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>${spotless.plugin.version}</version>
        <configuration>
          <ratchetFrom>${spotless.ratchetFrom}</ratchetFrom>
          <java>
            <eclipse>
              <file>${maven.multiModuleProjectDirectory}/eclipse/VaadinJavaConventions.xml</file>
            </eclipse>
            <endWithNewline/>
            <removeUnusedImports/>
            <importOrder>
              <file>${maven.multiModuleProjectDirectory}/eclipse/flow.importorder</file>
            </importOrder>
            <forbidWildcardImports/>
            <licenseHeader>
              <file>${spotless.license-header}</file>
            </licenseHeader>
          </java>
          <typescript>
            <includes>
              <include>src/**/*.js</include>
              <include>src/**/*.ts</include>
              <include>frontend/**/*.js</include>
              <include>frontend/**/*.ts</include>
            </includes>
            <excludes>
              <exclude>src/main/frontend/generated/**</exclude>
            </excludes>
            <prettier>
              <prettierVersion>${spotless.prettier.version}</prettierVersion>
              <configFile>${maven.multiModuleProjectDirectory}/.prettierrc</configFile>
              <npmInstallCache>${maven.multiModuleProjectDirectory}/target/.spotless-npm-install-cache</npmInstallCache>
            </prettier>
          </typescript>
          <css>
            <includes>
              <include>src/**/*.css</include>
              <include>frontend/**/*.css</include>
            </includes>
            <excludes>
              <exclude>src/main/frontend/generated/**</exclude>
            </excludes>
            <prettier>
              <prettierVersion>${spotless.prettier.version}</prettierVersion>
              <configFile>${maven.multiModuleProjectDirectory}/.prettierrc</configFile>
              <npmInstallCache>${maven.multiModuleProjectDirectory}/target/.spotless-npm-install-cache</npmInstallCache>
            </prettier>
          </css>
          <pom>
            <sortPom>
              <expandEmptyElements>false</expandEmptyElements>
            </sortPom>
          </pom>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.16.0</version>
        <!-- Runs NullAway over every module. OnlyNullMarked means a module
             is checked exactly as far as its packages opt in with
             @NullMarked, so modules that have not opted in yet compile
             unchanged. -->
        <configuration>
          <compilerArgs>
            <arg>-XDcompilePolicy=simple</arg>
            <arg>-XDaddTypeAnnotationsToSymbol=true</arg>
            <arg>--should-stop=ifError=FLOW</arg>
            <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
            <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
            <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
            <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
            <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
            <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
            <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
            <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
            <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
            <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
            <arg>-Xplugin:ErrorProne -XepDisableAllChecks -Xep:NullAway:ERROR -XepOpt:NullAway:JSpecifyMode=true -XepOpt:NullAway:OnlyNullMarked=true</arg>
          </compilerArgs>
          <annotationProcessorPaths>
            <path>
              <groupId>com.google.errorprone</groupId>
              <artifactId>error_prone_core</artifactId>
              <version>2.53.0</version>
            </path>
            <path>
              <groupId>com.uber.nullaway</groupId>
              <artifactId>nullaway</artifactId>
              <version>0.14.4</version>
            </path>
          </annotationProcessorPaths>
          <fork>true</fork>
          <!-- Tests deliberately exercise APIs that are deprecated for
               removal, so the removal lint only produces noise there. It
               stays on for src/main, where using such an API is a real
               finding. -->
          <testCompilerArgument>-Xlint:-removal</testCompilerArgument>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.4.0</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
            <phase>verify</phase>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.12.0</version>
        <configuration>
          <quiet>true</quiet>
          <!-- Generate on the class path even for jars that declare an
               Automatic-Module-Name; on the module path, dependencies with
               overlapping packages (e.g. jakarta.servlet and Tomcat) fail -->
          <legacyMode>true</legacyMode>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <phase>verify</phase>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.7.0</version>
      </plugin>

      <plugin>
        <groupId>org.commonjava.maven.plugins</groupId>
        <artifactId>directory-maven-plugin</artifactId>
        <version>1.0</version>
        <executions>
          <execution>
            <id>set-root-dir-for-common-lifecycle</id>
            <goals>
              <goal>highest-basedir</goal>
            </goals>
            <phase>initialize</phase>
            <configuration>
              <property>project.rootdir</property>
            </configuration>
          </execution>
          <execution>
            <id>set-root-dir-for-clean-lifecycle</id>
            <goals>
              <goal>highest-basedir</goal>
            </goals>
            <phase>pre-clean</phase>
            <configuration>
              <property>project.rootdir</property>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>${maven.clean.plugin.version}</version>
        <configuration>
          <filesets>
            <fileset>
              <directory>${project.rootdir}/driver</directory>
            </fileset>
            <fileset>
              <directory>${project.rootdir}/driver_zips</directory>
            </fileset>
            <fileset>
              <directory>error-screenshots</directory>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>parse-version</id>
            <goals>
              <goal>parse-version</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>biz.aQute.bnd</groupId>
        <artifactId>bnd-maven-plugin</artifactId>
        <version>${bnd.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>bnd-process</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!-- Indexes a module's own classes into META-INF/jandex.idx, which
             is where the Quarkus extension reads them from. Modules with no
             Jandex consumer opt out by setting jandex.skip to true. -->
        <groupId>io.smallrye</groupId>
        <artifactId>jandex-maven-plugin</artifactId>
        <version>${jandex.plugin.version}</version>
        <configuration>
          <indexVersion>${jandex.format.version}</indexVersion>
        </configuration>
        <executions>
          <execution>
            <id>make-index</id>
            <goals>
              <goal>jandex</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!-- Reports calls of the APIs that send JavaScript as a string in the
             main classes, so that Flow itself keeps working with a strict
             Content Security Policy. flow-tests sets forbiddenapis.skip,
             because its test applications call these APIs on purpose. -->
        <groupId>de.thetaphi</groupId>
        <artifactId>forbiddenapis</artifactId>
        <version>${forbiddenapis.version}</version>
        <configuration>
          <signaturesFiles>
            <signaturesFile>${maven.multiModuleProjectDirectory}/forbidden-apis/string-javascript.txt</signaturesFile>
          </signaturesFiles>
          <suppressAnnotations>
            <suppressAnnotation>com.vaadin.flow.internal.SuppressForbidden</suppressAnnotation>
          </suppressAnnotations>
        </configuration>
        <executions>
          <execution>
            <id>string-javascript</id>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <extensions>
      <!-- Enabling the use of SSH for deployment -->
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-ssh-external</artifactId>
        <version>3.5.3</version>
      </extension>
    </extensions>
  </build>
  <profiles>
    <profile>
      <id>install-git-hooks</id>
      <activation>
        <property>
          <name>!env.CI</name>
        </property>
        <file>
          <missing>${maven.multiModuleProjectDirectory}/.husky/_</missing>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <inherited>false</inherited>
            <executions>
              <execution>
                <id>install-git-hooks</id>
                <goals>
                  <goal>exec</goal>
                </goals>
                <phase>initialize</phase>
                <configuration>
                  <executable>node</executable>
                  <workingDirectory>${maven.multiModuleProjectDirectory}</workingDirectory>
                  <arguments>
                    <argument>${maven.multiModuleProjectDirectory}/scripts/installHusky.js</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>default</id>
      <activation>
        <property>
          <name>!release</name>
        </property>
      </activation>
      <modules>
        <module>flow-tests</module>
      </modules>
    </profile>

    <profile>
      <id>validation</id>
      <properties>
        <maven.javadoc.skip>false</maven.javadoc.skip>
      </properties>
    </profile>
    <profile>
      <id>all-tests</id>
      <properties>
        <groups/>
        <excludedGroups/>
      </properties>
    </profile>
    <profile>
      <id>slow-tests</id>
      <properties>
        <groups>${slowTestGroups}</groups>
        <excludedGroups/>
      </properties>
    </profile>
    <profile>
      <!-- Collects unit test coverage with JaCoCo. The per-module XML
           reports (target/site/jacoco/jacoco.xml) are fed to Sonar via
           sonar.coverage.jacoco.xmlReportPaths. -->
      <id>coverage</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>${jacoco.plugin.version}</version>
            <executions>
              <execution>
                <id>prepare-jacoco-agent</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
                <configuration>
                  <propertyName>jacoco.agent.argLine</propertyName>
                </configuration>
              </execution>
              <execution>
                <id>jacoco-report</id>
                <goals>
                  <goal>report</goal>
                </goals>
                <configuration>
                  <formats>
                    <format>XML</format>
                  </formats>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>sonar-cloud</id>
      <properties>
        <sonar.java.source>${maven.compiler.source}</sonar.java.source>
        <sonar.organization>vaadin</sonar.organization>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
        <!-- override properties for legacy sonar instance -->
        <sonar.analysis.mode/>
        <sonar.issuesReport.console.enable/>
        <sonar.issuesReport.html.enable/>
      </properties>
    </profile>
    <profile>
      <id>apicmp</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.siom79.japicmp</groupId>
            <artifactId>japicmp-maven-plugin</artifactId>
            <version>${japicmp.maven.plugin.version}</version>
            <configuration>
              <oldVersion>
                <dependency>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>${project.artifactId}</artifactId>
                  <version>${api.reference.version}</version>
                  <type>jar</type>
                </dependency>
              </oldVersion>
              <newVersion>
                <file>
                  <path>${project.build.directory}/${project.artifactId}-${project.version}.jar</path>
                </file>
              </newVersion>
              <parameter>
                <onlyModified>true</onlyModified>
                <ignoreMissingClasses>true</ignoreMissingClasses>
                <skipXmlReport>true</skipXmlReport>
                <skipDiffReport>true</skipDiffReport>
                <ignoreMissingOldVersion>true</ignoreMissingOldVersion>
              </parameter>
              <skip>${flow.apicmp.skip}</skip>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>cmp</goal>
                </goals>
                <phase>verify</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
