project(xsi:schemaLocation = 'http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd'
        xmlns:xsi          = http://www.w3.org/2001/XMLSchema-instance
        xmlns              = http://maven.apache.org/POM/4.0.0)
{
    modelVersion = 4.0.0
    parent {
        groupId    = org.springframework.boot
        artifactId = spring-boot-starter-parent
        version    = 3.0.1
        relativePath
    }
    groupId     = org.libxmq
    artifactId  = xmq
    version     = 0.1.4
    name        = libxmq
    description = 'Library to work with xmq/xml/html/json.'
    url         = https://libxmq.org
    properties {
        project.build.sourceEncoding = UTF-8
        maven.compiler.release       = 17
    }
    licenses {
        license {
            name = 'MIT License'
            url  = https://raw.githubusercontent.com/libxmq/xmq/refs/heads/master/LICENSE
        }
    }
    developers {
        developer {
            id    = weetmuts
            name  = 'Fredrik Öhrström'
            email = oehrstroem@gmail.com
        }
    }
    scm {
        connection          = scm:git:https://github.com/libxmq/xmq.git
        developerConnection = scm:git:https://github.com/libxmq/xmq.git
        url                 = https://github.com/libxmq/xmq
    }
    dependencies {
        // Language Server Protocol
        dependency {
            groupId    = org.eclipse.lsp4j
            artifactId = org.eclipse.lsp4j
            version    = 1.0.0
        }
        // Logging
        dependency {
            groupId    = ch.qos.logback
            artifactId = logback-classic
            version    = 1.6.3
        }
        // Tests
        dependency {
            groupId    = junit
            artifactId = junit
            version    = 4.13.2
            scope      = test
        }
    }
    build {
        directory = build
        plugins {
            plugin {
                groupId    = org.codehaus.mojo
                artifactId = versions-maven-plugin
                version    = 2.16.2
            }
            plugin {
                groupId    = org.apache.maven.plugins
                artifactId = maven-compiler-plugin
                version    = 3.14.1
                configuration {
                    release = 17
                }
            }
            plugin {
                groupId    = org.springframework.boot
                artifactId = spring-boot-maven-plugin
                configuration {
                    mainClass  = org.libxmq.imp.Main
                    executable = false
                    classifier = exec
                }
            }
            // Attach sources
            plugin {
                groupId    = org.apache.maven.plugins
                artifactId = maven-source-plugin
                version    = 3.3.0
                executions {
                    execution {
                        id = attach-sources
                        goals {
                            goal = jar-no-fork
                        }
                    }
                }
            }
            // Attach Javadocs
            plugin {
                groupId    = org.apache.maven.plugins
                artifactId = maven-javadoc-plugin
                version    = 3.12.0
                executions {
                    execution {
                        id = attach-javadocs
                        goals {
                            goal = jar
                        }
                    }
                }
                configuration {
                    // Fail build if Javadoc errors are found
                    failOnError = true
                    // Treat warnings as errors
                    additionalJOptions {
                        additionalJOption = -Xdoclint:all
                    }
                }
            }
            plugin {
                groupId    = org.apache.maven.plugins
                artifactId = maven-jar-plugin
                configuration {
                    archive {
                        manifestEntries {
                            Automatic-Module-Name = org.libxmq
                        }
                    }
                }
            }
            // Sign artifacts
            plugin {
                groupId    = org.apache.maven.plugins
                artifactId = maven-gpg-plugin
                version    = 3.2.4
                executions {
                    execution {
                        id    = sign-artifacts
                        phase = verify
                        goals {
                            goal = sign
                        }
                    }
                }
            }
            // Upload to Maven Central
            plugin {
                groupId    = org.sonatype.central
                artifactId = central-publishing-maven-plugin
                version    = 0.9.0
                extensions = true
                configuration {
                    publishingServerId = central
                }
            }
        }
    }
}