<?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-parent</artifactId>
    <version>3.0.0</version>
  </parent>
  <groupId>com.vaadin</groupId>
  <artifactId>vaadin-swing-bridge</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>pom</packaging>
  <name>Vaadin Swing Bridge</name>
  <description>Vaadin Swing Bridge - Run Swing applications in the browser using Vaadin Flow</description>
  <url>https://github.com/vaadin/vaadin-swing-bridge</url>

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

  <developers>
    <developer>
      <name>Vaadin</name>
      <organization>Vaadin Ltd</organization>
      <organizationUrl>https://vaadin.com</organizationUrl>
    </developer>
  </developers>

  <modules>
    <module>swing-bridge-patch</module>
    <module>swing-bridge-graphics</module>
    <module>swing-bridge-flow</module>
    <module>swing-bridge-playground</module>
    <module>simple-swing-apps</module>
  </modules>

  <scm>
    <connection>scm:git:https://github.com/vaadin/vaadin-swing-bridge.git</connection>
    <developerConnection>scm:git:git@github.com:vaadin/vaadin-swing-bridge.git</developerConnection>
    <url>https://github.com/vaadin/vaadin-swing-bridge</url>
  </scm>

  <properties>
    <spotless.plugin.version>3.1.0</spotless.plugin.version>
    <spotless.license-header>https://github.com/vaadin/flow/raw/main/eclipse/vaadin-commercial-license-header.txt</spotless.license-header>
    <junit-jupiter.version>5.10.2</junit-jupiter.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${junit-jupiter.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>${spotless.plugin.version}</version>
        <configuration>
          <java>
            <eclipse>
              <file>https://github.com/vaadin/flow/raw/main/eclipse/VaadinJavaConventions.xml</file>
            </eclipse>
            <endWithNewline/>
            <removeUnusedImports/>
            <importOrder>
              <file>https://github.com/vaadin/flow/raw/main/eclipse/flow.importorder</file>
            </importOrder>
            <forbidWildcardImports/>
            <licenseHeader>
              <file>${spotless.license-header}</file>
            </licenseHeader>
          </java>
          <pom>
            <sortPom>
              <expandEmptyElements>false</expandEmptyElements>
            </sortPom>
          </pom>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <!--
            Sources and javadoc JARs with only a LICENSE notice.
            Satisfies Maven Central requirements without exposing source code.
          -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <executions>
              <execution>
                <id>license-sources-jar</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <phase>package</phase>
                <configuration>
                  <classifier>sources</classifier>
                  <classesDirectory>${maven.multiModuleProjectDirectory}/src/main/resources</classesDirectory>
                  <includes>
                    <include>META-INF/LICENSE.txt</include>
                  </includes>
                </configuration>
              </execution>
              <execution>
                <id>license-javadoc-jar</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <phase>package</phase>
                <configuration>
                  <classifier>javadoc</classifier>
                  <classesDirectory>${maven.multiModuleProjectDirectory}/src/main/resources</classesDirectory>
                  <includes>
                    <include>META-INF/LICENSE.txt</include>
                  </includes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
