<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-swing-bridge</artifactId>
    <version>1.1-SNAPSHOT</version>
  </parent>
  <artifactId>swing-bridge-patch</artifactId>
  <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.source>21</maven.compiler.source>
    <maven.compiler.target>21</maven.compiler.target>
    <spotless.license-header>${maven.multiModuleProjectDirectory}/eclipse/gpl-v2-cpe.txt</spotless.license-header>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>swing-bridge-graphics</artifactId>
      <version>${project.version}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.14.1</version>
        <configuration>
          <compilerArgs>
            <compilerArg>--add-exports=java.base/jdk.internal.util=ALL-UNNAMED</compilerArg>
          </compilerArgs>

        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.4.2</version>
        <configuration>
          <excludes>
            <exclude>sun/font/FontManager.class</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <!-- Override parent: GPL requires distributing real sources -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <executions>
              <execution>
                <id>license-sources-jar</id>
                <phase>none</phase>
              </execution>
              <execution>
                <id>license-javadoc-jar</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <configuration>
              <additionalJOptions>
                <additionalJOption>--add-exports=java.base/jdk.internal.util=ALL-UNNAMED</additionalJOption>
              </additionalJOptions>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
