<?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>com.vaadin</groupId>
    <artifactId>vaadin-swing-bridge</artifactId>
    <version>1.4.0-alpha1</version>
  </parent>
  <groupId>com.vaadin</groupId>
  <artifactId>swing-bridge-patch</artifactId>
  <version>1.4.0-alpha1</version>
  <name>Vaadin Swing Bridge Patch</name>
  <description>JDK internal patches for the Vaadin Swing Bridge</description>
  <licenses>
    <license>
      <name>GPLv2 + CPE</name>
      <url>https://openjdk.org/legal/gplv2+ce.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <properties>
    <maven.compiler.target>21</maven.compiler.target>
    <spotless.license-header>${maven.multiModuleProjectDirectory}/eclipse/gpl-v2-cpe.txt</spotless.license-header>
    <maven.compiler.source>21</maven.compiler.source>
  </properties>
  <dependencies>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>swing-bridge-graphics</artifactId>
      <version>1.4.0-alpha1</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <configuration>
          <java>
            <excludes>
              <exclude>src/main/java/java/awt/KeyboardFocusManager.java</exclude>
              <exclude>src/main/java/javax/swing/RepaintManager.java</exclude>
              <exclude>src/test/java/**</exclude>
            </excludes>
          </java>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.14.1</version>
        <executions>
          <execution>
            <id>default-testCompile</id>
            <configuration>
              <compilerArgs combine.self="override">
                <compilerArg>--add-exports=java.desktop/sun.awt=ALL-UNNAMED</compilerArg>
              </compilerArgs>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <compilerArgs>
            <compilerArg>--patch-module</compilerArg>
            <compilerArg>java.desktop=${project.basedir}/src/main/java</compilerArg>
            <compilerArg>--add-reads=java.desktop=ALL-UNNAMED</compilerArg>
            <compilerArg>--add-exports=java.base/jdk.internal.util=java.desktop</compilerArg>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.4.2</version>
        <configuration>
          <excludes>
            <exclude>sun/font/FontManager.class</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>patch-classes-for-tests</id>
            <phase>process-test-classes</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/patch-classes</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.build.outputDirectory}</directory>
                  <excludes>
                    <exclude>sun/font/FontManager.class</exclude>
                  </excludes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.8.1</version>
        <executions>
          <execution>
            <id>dependency-paths</id>
            <goals>
              <goal>properties</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.5.4</version>
        <configuration>
          <argLine>--patch-module java.desktop=${project.build.directory}/patch-classes -Xbootclasspath/a:${com.vaadin:swing-bridge-graphics:jar} --add-reads=java.desktop=ALL-UNNAMED --add-exports=java.desktop/sun.font=ALL-UNNAMED --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.desktop/sun.awt.dnd=ALL-UNNAMED --add-exports=java.desktop/sun.awt.dnd.peer=ALL-UNNAMED --add-exports=java.base/sun.nio.cs=ALL-UNNAMED --add-exports=java.desktop/sun.java2d=ALL-UNNAMED --add-exports=java.desktop/sun.java2d.pipe=ALL-UNNAMED --add-exports=java.desktop/sun.awt.datatransfer=ALL-UNNAMED --add-exports=java.desktop/sun.awt.image=ALL-UNNAMED --add-exports=java.desktop/java.awt.peer=ALL-UNNAMED --add-exports=java.desktop/java.awt.dnd=ALL-UNNAMED --add-exports=java.desktop/java.awt.dnd.peer=ALL-UNNAMED --add-exports=java.desktop/sun.print=ALL-UNNAMED --add-exports=java.desktop/sun.swing=ALL-UNNAMED --add-opens=java.desktop/java.awt.event=ALL-UNNAMED --add-opens=java.desktop/sun.awt=ALL-UNNAMED --add-opens=java.desktop/java.awt.dnd=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED</argLine>
          <systemPropertyVariables>
            <java.awt.headless>false</java.awt.headless>
          </systemPropertyVariables>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
