All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.gitlab.jaxsonp.openapipublish.maven.SwaggerHubPublishMojo.kt Maven / Gradle / Ivy

There is a newer version: 0.2.0-RC3
Show newest version
package io.gitlab.jaxsonp.openapipublish.maven

import io.gitlab.jaxsonp.openapipublish.core.publishers.SwaggerHubPublisher
import org.apache.maven.plugin.AbstractMojo
import org.apache.maven.plugins.annotations.LifecyclePhase
import org.apache.maven.plugins.annotations.Mojo
import org.apache.maven.plugins.annotations.Parameter

@Mojo(name = "swaggerhub-publish", defaultPhase = LifecyclePhase.DEPLOY)
class SwaggerHubPublishMojo: AbstractMojo() {

    @Parameter(required = true)
    lateinit var apiDir: String
    @Parameter
    var apiVersion: String? = null
    @Parameter
    var swaggerHubOnPremiseUrl: String? = null
    @Parameter
    var apiKey: String? = null
    @Parameter(required = true)
    lateinit var owner: String
    @Parameter
    var privateApi: Boolean? = null
    @Parameter
    var force: Boolean? = null

    override fun execute() {
        SwaggerHubPublisher(
            apiDir = apiDir,
            apiVersion = apiVersion,
            swaggerHubOnPremiseUrl = swaggerHubOnPremiseUrl,
            apiKey = apiKey,
            owner = owner,
            privateApi = privateApi,
            force = force,
        ).publish()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy