ext.createPom = { pom, project ->

    pom.url = "$projectUrl"
    pom.inceptionYear = project.projectInceptionYear
    pom.name = project.name
    pom.description = project.name

    pom.organization {
        name = "Apereo Foundation"
        url = "https://www.apereo.org"
    }

    pom.issueManagement {
        system = project.projectIssueSystem
        url = project.projectIssueUrl
    }

    pom.scm {
        url = project.projectScmUrl
        connection = project.projectScmUrl
        developerConnection = project.projectScmUrl
    }

    pom.licenses {
        license {
            name = project.projectLicenseName
            url = project.projectLicenseUrl
            distribution = project.projectLicenseDistribution
        }
    }

    pom.developers {
        developer {
            id = "leleuj"
            name = "Jérôme Leleu"
        }
        developer {
            id = "tduehr"
            name = "Timur Duehr"
        }
        developer {
            id = "mindblender"
            name = "Jeff Sittler"
        }
        developer {
            id = "apetro"
            name = "Andrew Petro"
        }
        developer {
            id = "wgthom"
            name = "William G. Thompson"
        }
        developer {
            id = "serac"
            name = "Marvin S. Addison"
        }
        developer {
            id = "battags"
            name = "Scott Battaglia"
        }
        developer {
            id = "mmoayyed"
            name = "Misagh Moayyed"
        }
        developer {
            id = "robertoschwald"
            name = "Robert Oschwald"
        }
        developer {
            id = "frett"
            name = "Daniel Frett"
        }
        developer {
            id = "dima767"
            name = "Dmitriy Kopylenko"
        }
        developer {
            id = "tsschmidt"
            name = "Travis Schmidt"
        }
        developer {
            id = "hdeadman"
            name = "Hal Deadman"
        }
    }

    pom.contributors {
        contributor {
            name = "Adam Rybicki"
            email = "arybicki@unicon.net"
        }
        contributor {
            name = "Andrew Tillinghast"
            email = "atilling@conncoll.edu"
        }
        contributor {
            name = "Arnaud Lesueur"
            email = "arnaud.lesueur@gmail.com"
        }
        contributor {
            name = "Drew Mazurek"
            email = "dmazurek@unicon.net"
        }
        contributor {
            name = "Eric Dalquist"
            email = "eric.dalquist@doit.wisc.edu"
        }
        contributor {
            name = "Eric Pierce"
            email = "epierce@usf.edu"
        }
        contributor {
            name = "Frederic Esnault"
            email = "esnault.frederic@gmail.com"
        }
        contributor {
            name = "Howard Gilbert"
            email = "Howard.Gilbert@yale.edu"
        }
        contributor {
            name = "Jan Van der Velpen"
            email = "velpi@industria.be"
        }
        contributor {
            name = "John Martin"
            email = "jmartin@unicon.net"
        }
        contributor {
            name = "MarcAntoine Garrigue"
            email = "marc.antoine.garrigue@gmail.com"
        }
        contributor {
            name = "Mihir Patel"
            email = "exploremihir@gmail.com"
        }
        contributor {
            name = "Fredrik Jönsson"
            email = "fjo@kth.se"
        }
    }

    pom.mailingLists {
        mailingList {
            name = "cas-user"
            subscribe = "https://groups.google.com/a/apereo.org/forum/#!forum/cas-user"
            unsubscribe = "https://groups.google.com/a/apereo.org/forum/#!forum/cas-user"
            post = "cas-user@apereo.org"
            archive = "https://groups.google.com/a/apereo.org/forum/#!forum/cas-user"
        }
        mailingList {
            name = "cas-dev"
            subscribe = "https://groups.google.com/a/apereo.org/forum/#!forum/cas-dev"
            unsubscribe = "https://groups.google.com/a/apereo.org/forum/#!forum/cas-dev"
            post = "cas-dev@apereo.org"
            archive = "https://groups.google.com/a/apereo.org/forum/#!forum/cas-dev"
        }
        mailingList {
            name = "cas-announce"
            subscribe = "https://groups.google.com/a/apereo.org/forum/#!forum/cas-announce"
            unsubscribe = "https://groups.google.com/a/apereo.org/forum/#!forum/cas-announce"
            post = "cas-announce@apereo.org"
            archive = "https://groups.google.com/a/apereo.org/forum/#!forum/cas-announce"
        }
    }
}

ext.createPomRepositories = { node ->
    def repositories = node.appendNode("repositories")

    def repository = repositories.appendNode("repository")
    repository.appendNode("id", "maven-central")
    repository.appendNode("url", "https://repo.maven.apache.org/maven2")
    repository.appendNode("releases").appendNode("enabled", "true")
    repository.appendNode("snapshots").appendNode("enabled", "false")

    repository = repositories.appendNode("repository")
    repository.appendNode("id", "shib-release")
    repository.appendNode("url", "https://build.shibboleth.net/nexus/content/repositories/releases")
    repository.appendNode("releases").appendNode("enabled", "true")
    repository.appendNode("snapshots").appendNode("enabled", "false")

    repository = repositories.appendNode("repository")
    repository.appendNode("id", "couchbase")
    repository.appendNode("url", "https://files.couchbase.com/maven2/")
    repository.appendNode("releases").appendNode("enabled", "true")
    repository.appendNode("snapshots").appendNode("enabled", "false")

    repository = repositories.appendNode("repository")
    repository.appendNode("id", "jitpack")
    repository.appendNode("url", "https://jitpack.io")
    repository.appendNode("releases").appendNode("enabled", "true")
    repository.appendNode("snapshots").appendNode("enabled", "false")

    repository = repositories.appendNode("repository")
    repository.appendNode("id", "sonatype-snapshot")
    repository.appendNode("url", "https://oss.sonatype.org/content/repositories/snapshots")
    repository.appendNode("snapshots").appendNode("enabled", "true")
    repository.appendNode("releases").appendNode("enabled", "false")

    repository = repositories.appendNode("repository")
    repository.appendNode("id", "apache-snapshot")
    repository.appendNode("url", "https://repository.apache.org/content/repositories/snapshots")
    repository.appendNode("snapshots").appendNode("enabled", "true")
    repository.appendNode("releases").appendNode("enabled", "false")

}
