<?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>

  <groupId>pl.unforgiven</groupId>
  <artifactId>superfields</artifactId>
  <name>SuperFields</name>
  <description>Code for various Vaadin 24 fields and other components.</description>
  <url>https://www.unforgiven.pl/superfields</url>
  <version>0.7.77-SNAPSHOT</version>

  <properties>
    <maven.compiler.source>21</maven.compiler.source>
    <maven.compiler.target>21</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <vaadin.version>25.1-SNAPSHOT</vaadin.version>
    <maven.jar.plugin.version>3.1.2</maven.jar.plugin.version>
    <javadoc.plugin.version>3.4.1</javadoc.plugin.version>
  </properties>

  <licenses>
    <license>
      <name>Apache 2</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-bom</artifactId>
        <type>pom</type>
        <scope>import</scope>
        <version>${vaadin.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-core</artifactId>
      <version>${vaadin.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.github.mvysny.kaributesting</groupId>
      <artifactId>karibu-testing-v10</artifactId>
      <version>2.7.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <!-- configuration to enable publishing to Vaadin Directory -->
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${maven.jar.plugin.version}</version>
        <configuration>
          <archive>
            <index>true</index>
            <manifest>
              <addClasspath>false</addClasspath>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
            <manifestEntries>
              <Vaadin-Package-Version>1</Vaadin-Package-Version>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!-- for automated sonarcloud checks with default settings -->
    <profile>
      <id>sonar</id>
      <properties>
        <sonar.projectKey>vaadin-miki_super-fields</sonar.projectKey>
        <sonar.organization>vaadin-miki</sonar.organization>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
      </properties>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.sonarsource.scanner.maven</groupId>
              <artifactId>sonar-maven-plugin</artifactId>
              <version>3.7.0.1746</version>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.14</version>
            <executions>
              <execution>
                <id>prepare-agent</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
              <execution>
                <id>report</id>
                <goals>
                  <goal>report</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>deploy-central</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.2.1</version>
            <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>
            <version>${javadoc.plugin.version}</version>
            <configuration>
              <doclint>none</doclint>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.0.1</version>
            <configuration>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>0.7.0</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <autoPublish>true</autoPublish>
              <waitUntil>published</waitUntil>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>deploy-github</id>
      <distributionManagement>
        <repository>
          <id>github</id>
          <name>GitHub Apache Maven Packages</name>
          <url>https://maven.pkg.github.com/vaadin-miki/super-fields</url>
        </repository>
      </distributionManagement>
    </profile>
  </profiles>

  <organization>
    <name>Unforgiven.pl</name>
    <url>https://www.unforgiven.pl</url>
  </organization>

  <developers>
    <developer>
      <name>Miki</name>
      <email>miki@unforgiven.pl</email>
      <organization>Unforgiven.pl</organization>
      <organizationUrl>https://www.unforgiven.pl</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/vaadin-miki/super-fields.git</connection>
    <developerConnection>scm:git:git://github.com/vaadin-miki/super-fields.git</developerConnection>
    <url>https://github.com/vaadin-miki/super-fields</url>
  </scm>

</project>
