<?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>se.alipsa</groupId>
   <artifactId>swing-widgets</artifactId>
   <version>1.1.1</version>
   <packaging>jar</packaging>

   <name>Swing Widgets</name>
   <description>Useful Swing components for java 11 and later</description>
   <url>https://github.com/Alipsa/swing-widgets</url>
   <licenses>
      <license>
         <name>MIT License</name>
         <url>https://raw.githubusercontent.com/Alipsa/swing-widgets/master/LICENSE</url>
      </license>
   </licenses>
   <developers>
      <developer>
         <name>Per Nyfelt</name>
         <email>per.nyfelt@alipsa.se</email>
         <organization>Alipsa HB</organization>
         <organizationUrl>http://www.alipsa.se</organizationUrl>
      </developer>
   </developers>
   <scm>
      <connection>scm:git:https://github.com/Alipsa/swing-widgets.git</connection>
      <developerConnection>scm:git:https://github.com/Alipsa/swing-widgets.git</developerConnection>
      <url>https://github.com/Alipsa/swing-widgets/tree/master</url>
   </scm>

   <properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      <maven.compiler.release>11</maven.compiler.release>
      <junit.version>5.14.4</junit.version> <!-- junit 6 requires java 17 or higher -->
   </properties>

   <dependencies>
      <dependency>
         <groupId>org.junit.jupiter</groupId>
         <artifactId>junit-jupiter</artifactId>
         <version>${junit.version}</version>
         <scope>test</scope>
      </dependency>
   </dependencies>

   <build>
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>3.6.2</version>
            <executions>
               <execution>
                  <id>enforce-releases-maven-java</id>
                  <goals>
                     <goal>enforce</goal>
                  </goals>
                  <configuration>
                     <rules>
                        <requireMavenVersion>
                           <version>[3.6.3,)</version>
                           <level>ERROR</level>
                           <message>Please use maven version 3.6.3 or higher</message>
                        </requireMavenVersion>
                        <requireJavaVersion>
                           <version>11</version>
                           <level>WARN</level>
                           <message>Please use Java 11 or higher</message>
                        </requireJavaVersion>
                     </rules>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>versions-maven-plugin</artifactId>
            <version>2.21.0</version>
            <configuration>
               <rulesUri>file://${basedir}/version-plugin-rules.xml</rulesUri>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.15.0</version>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.5.5</version>
            <configuration>
               <useModulePath>false</useModulePath>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.4.0</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>3.12.0</version>
            <configuration>
               <doclint>all,-missing</doclint>
               <show>public</show>
            </configuration>
            <executions>
               <execution>
                  <id>attach-javadocs</id>
                  <goals>
                     <goal>jar</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <version>3.21.0</version>
            <configuration>
               <generateReports>false</generateReports>
            </configuration>
            <executions>
               <execution>
                  <phase>test</phase>
                  <goals>
                     <goal>site</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>com.diffplug.spotless</groupId>
            <artifactId>spotless-maven-plugin</artifactId>
            <version>2.43.0</version>
            <configuration>
               <java>
                  <googleJavaFormat>
                     <version>1.23.0</version>
                     <style>GOOGLE</style>
                  </googleJavaFormat>
               </java>
            </configuration>
            <executions>
               <execution>
                  <goals>
                     <goal>check</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>com.github.spotbugs</groupId>
            <artifactId>spotbugs-maven-plugin</artifactId>
            <version>4.9.8.3</version>
            <configuration>
               <excludeFilterFile>${project.basedir}/spotbugs-exclude.xml</excludeFilterFile>
            </configuration>
            <executions>
               <execution>
                  <goals>
                     <goal>check</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>
   <profiles>
      <profile>
         <id>release</id>
         <build>
            <plugins>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-gpg-plugin</artifactId>
                  <version>3.2.8</version>
                  <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.10.0</version>
                  <extensions>true</extensions>
                  <configuration>
                     <publishingServerId>central</publishingServerId>
                     <autoPublish>true</autoPublish>
                     <deploymentName>${project.groupId}-${project.artifactId}-${project.version}</deploymentName>
                  </configuration>
               </plugin>
            </plugins>
         </build>
      </profile>
   </profiles>
</project>
