plugins {
    id "maven-publish"
    id "java-gradle-plugin"
    id "com.gradle.plugin-publish"
}

description = "Collection of Maven related Gradle plugins"

dependencies {
    implementation 'org.apache.maven:maven-model:3.9.11'
    implementation 'org.apache.maven:maven-artifact:3.9.11'

    api project(":okhttp-plugin")

    testImplementation project(":test-common")
}

gradlePlugin {
    plugins {
        war {
            id = "io.freefair.war"
            implementationClass = "io.freefair.gradle.plugins.maven.war.WarPlugin"
            displayName = "War Plugin"
            description = "Maven-like extensions for the normal war plugin"
            tags.set(['war'])
        }
        warOverlay {
            id = "io.freefair.war-overlay"
            implementationClass = "io.freefair.gradle.plugins.maven.war.WarOverlayPlugin"
            displayName = "War Overlay Plugin"
            description = "Maven-like overlays for war tasks."
            tags.set(['war', 'maven', 'overlay'])
        }
        warAttachClasses {
            id = "io.freefair.war-attach-classes"
            implementationClass = "io.freefair.gradle.plugins.maven.war.WarAttachClassesPlugin"
            displayName = "War Attach Classes Plugin"
            description = "Maven-like attachClasses option for the war task."
            tags.set(['war', 'maven', 'attachClasses'])
        }
        warArchiveClasses {
            id = "io.freefair.war-archive-classes"
            implementationClass = "io.freefair.gradle.plugins.maven.war.WarArchiveClassesPlugin"
            displayName = "War Archive Classes Plugin"
            description = "Maven-like archiveClasses options for war tasks."
            tags.set(['war', 'maven', 'archiveClasses'])
        }
        aggregateJavadoc {
            id = "io.freefair.aggregate-javadoc-legacy"
            implementationClass = "io.freefair.gradle.plugins.maven.javadoc.LegacyAggregateJavadocPlugin"
            displayName = "Aggregate Javadoc Plugin"
            description = "Generate Javadoc over multiple projects"
            tags.set(['maven', 'javadoc', 'aggregate'])
        }
        aggregateJavadoc2 {
            id = "io.freefair.aggregate-javadoc"
            implementationClass = "io.freefair.gradle.plugins.maven.javadoc.AggregateJavadocPlugin"
            displayName = "Aggregate Javadoc Plugin"
            description = "Generate Javadoc over multiple projects"
            tags.set(['maven', 'javadoc', 'aggregate'])
        }
        aggregateJavadocJar {
            id = "io.freefair.aggregate-javadoc-jar"
            implementationClass = "io.freefair.gradle.plugins.maven.javadoc.AggregateJavadocJarPlugin"
            displayName = "Aggregate Javadoc Jar Plugin"
            description = "Generate Javadoc over multiple projects"
            tags.set(['maven', 'javadoc', 'aggregate', "jar"])
        }
        javadocLinks {
            id = "io.freefair.javadoc-links"
            implementationClass = "io.freefair.gradle.plugins.maven.javadoc.JavadocLinksPlugin"
            displayName = "Maven Jars Plugin"
            description = 'Link your javadoc against your dependencies'
            tags.set(['javadoc', 'links', 'javadoc.io'])
        }
        javadocUtf8 {
            id = "io.freefair.javadoc-utf-8"
            implementationClass = "io.freefair.gradle.plugins.maven.javadoc.JavadocUtf8Plugin"
            displayName = "Javadoc UTF-8 Plugin"
            description = "Set the output encoding of your javadoc tasks to 'UTF-8'"
            tags.set(['javadoc', 'utf-8'])
        }
        javadocs {
            id = "io.freefair.javadocs"
            implementationClass = "io.freefair.gradle.plugins.maven.javadoc.JavadocsPlugin"
            displayName = "Javadoc Plugin"
            description = 'Bundle of all our javadoc plugins'
            tags.set(['javadoc'])
        }
        mavenPublishJava {
            id = "io.freefair.maven-publish-java"
            implementationClass = "io.freefair.gradle.plugins.maven.MavenPublishJavaPlugin"
            displayName = "maven-publish Java"
            description = "Creates a mavenJava publication"
            tags.set(["maven-publish", "java"])
        }
        mavenPublishWar {
            id = "io.freefair.maven-publish-war"
            implementationClass = "io.freefair.gradle.plugins.maven.MavenPublishWarPlugin"
            displayName = "maven-publish War"
            description = "Creates a mavenWeb publication"
            tags.set(["maven-publish", "war"])
        }
        optional {
            id = "io.freefair.maven-optional"
            implementationClass = "io.freefair.gradle.plugins.maven.OptionalPlugin"
            displayName = "Maven optional Plugin"
            description = "Adds a maven-like 'optional' configuration to your gradle build"
            tags.set(["maven", "optional"])
        }
        centralValidatePoms {
            id = "io.freefair.maven-central.validate-poms"
            implementationClass = "io.freefair.gradle.plugins.maven.central.ValidatePomsPlugin"
            displayName = "Maven Central POM validation plugin"
            description = "Verify that your generated POM's fullfill the requirements for maven central"
            tags.set(["maven-central"])
        }
    }
}
