import com.github.kittinunf.fuel.httpGet import com.github.kittinunf.fuel.serialization.responseObject import kotlinx.serialization.Serializable import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.invoke import kotlinx.serialization.* import kotlinx.serialization.json.JSON @Serializable data class HttpBinUserAgentModel(var items: List = listOf()) @Serializable data class Component(var id: String = "") class PromotePlugin : Plugin { override fun apply(project: Project): Unit = project.run { tasks { register("greet") { group = "sample" description = "Prints a description of ${project.name}." doLast { println("I'm ${project.name}.") val result = "http://nexus.com/service/rest/v1/search" .httpGet(listOf("maven.groupId" to "com.promontech.enterprise", // "maven.artifactId" to "pt-enterprise-dependencies", "maven.baseVersion" to "0.16.0")) .authenticate("username", "aaaaaaaa") .responseObject() /* { request, response, result -> println("LJKASDLFKJASDLFKJ") println(request) println("result") println(response) val (bytes, error) = result println("error is $error") if (bytes != null) { println("[response bytes] ${String(bytes)}") } }*/ println(result) } } } } }