apply(plugin = "maven-publish") afterEvaluate { (extensions.findByType(com.android.build.gradle.LibraryExtension::class.java))?.let { extensions.configure { publications { register("release") { from(components["release"]) groupId = rootProject.group.toString() artifactId = project.name version = rootProject.version.toString() } } repositories { maven { url = uri(rootProject.ext["nexusUrl"] as String) credentials { username = rootProject.ext["nexusUser"] as String password = rootProject.ext["nexusPassword"] as String } } } } } }