<?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>org.vaadin.addons.componentfactory</groupId>
    <artifactId>vaadin-swing-bridge-javafx</artifactId>
    <version>1.0.0-alpha1</version>
  </parent>

  <artifactId>swing-bridge-javafx-flow</artifactId>
  <name>Vaadin Swing Bridge JavaFX Flow</name>
  <description>Vaadin Flow component that embeds JavaFX applications in the browser</description>

  <licenses>
    <license>
      <name>Vaadin Commercial License and Service Terms</name>
      <url>https://vaadin.com/commercial-license-and-service-terms</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <properties>
    <!-- The add-on's name and vendor in the Vaadin Directory. The Directory
         takes the name from the first upload and it cannot be changed. -->
    <vaadin.directory.title>JavaFX Extension for Vaadin SwingBridge</vaadin.directory.title>
    <vaadin.directory.vendor>Vaadin Ltd</vaadin.directory.vendor>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-core</artifactId>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>license-checker</artifactId>
    </dependency>
    <!--
      Reused, unchanged: the canvas component and its 2D context, the
      frontend/vaadinswingbridge JS modules (pointer batching, focus adoption,
      responsive/resize/DPR observers) and the HiDPI render-scale policy.
      See UPSTREAM.md for exactly what is reused and what is ported.
    -->
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>swing-bridge-flow</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.apache.logging.log4j</groupId>
          <artifactId>log4j-slf4j2-impl</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.vaadin.addons.componentfactory</groupId>
      <artifactId>swing-bridge-javafx-graphics</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.vaadin.addons.componentfactory</groupId>
      <artifactId>swing-bridge-javafx-patch</artifactId>
      <version>${project.version}</version>
    </dependency>
    <!-- JavaFX is supplied on the host JVM's module path, never bundled. -->
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-controls</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.servlet</groupId>
      <artifactId>jakarta.servlet-api</artifactId>
      <version>6.0.0</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <filtering>true</filtering>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
            <manifestEntries>
              <!-- Marks the jar as a Vaadin add-on. -->
              <Vaadin-Package-Version>1</Vaadin-Package-Version>
              <Implementation-Title>${vaadin.directory.title}</Implementation-Title>
              <Implementation-Vendor>${vaadin.directory.vendor}</Implementation-Vendor>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!-- mvn -Pdirectory package: target/<artifact>-<version>.zip, the add-on
         bundle to upload to the Vaadin Directory. -->
    <profile>
      <id>directory</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>3.7.1</version>
            <configuration>
              <appendAssemblyId>false</appendAssemblyId>
              <descriptors>
                <descriptor>src/main/assembly/assembly.xml</descriptor>
              </descriptors>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>single</goal>
                </goals>
                <phase>package</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
