GuilhE
GuilhE

Reputation: 11871

Extension of type 'BintrayExtension' does not exist

My project build.gradle:

...
plugins {
    id "maven-publish"
    id "com.jfrog.bintray" version "1.8.5"
}

My library module build.gradle:

apply plugin: 'kotlin'
apply plugin: 'java-library'
apply plugin: 'com.android.lint'
...
if (project.rootProject.file('local.properties').exists()) {
    apply from: rootProject.file('deploy-bintray.gradle.kts')
}

My library module deploy-bintray.gradle.kts:

import com.jfrog.bintray.gradle.BintrayExtension

apply(plugin = "maven-publish")
apply(plugin = "com.jfrog.bintray")

configure<BintrayExtension> {...}
configure<PublishingExtension> {...}

And this is the error I get from gradle assemble:

Extension of type 'BintrayExtension' does not exist. Currently registered extension types: [ExtraPropertiesExtension, KotlinJvmProjectExtension, KotlinTestsRegistry, DefaultArtifactPublicationSet, ReportingExtension, SourceSetContainer, JavaPluginExtension, JavaInstallationRegistry, LintOptions, PublishingExtension, BintrayExtension]

I've added:

buildscript {
    repositories {
        maven("https://plugins.gradle.org/m2")
    }

    dependencies {
        classpath("com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5")
    }
}

But I get the same output... If I open BintrayExtension.groovy the package name com.jfrog.bintray.gradle has this warning:

Package name mismatch. Actual: 'com.jfrog.bintray.gradle', expected: ''

and the class:

Class 'BintrayExtension' already exists in 'com.jfrog.bintray.gradle'

What am I missing here?

Upvotes: 2

Views: 5375

Answers (1)

GuilhE
GuilhE

Reputation: 11871

The solution is replacing:

id "com.jfrog.bintray" version "1.8.5"

with:

plugins.apply(BintrayPlugin::class.java)

Many thanks to Tom Eyckmans for pointing this out.

Upvotes: 4

Related Questions