No signature of method is applicable for argument types when trying to publish to JCenter with gradle

Viewed 5340

I'm trying to publish my project to JCenter with gradle.

I'm getting this error:

$ ./gradlew bintrayUpload

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/tomcaflisch/my-project/build.gradle' line: 32

* What went wrong:
A problem occurred evaluating root project 'my-project'.
> No signature of method: build_1izvkzzfcfkppgubyut54udzf.bintray() is applicable for argument types: (build_1izvkzzfcfkppgubyut54udzf$_run_closure3) values: [build_1izvkzzfcfkppgubyut54udzf$_run_closure3@30577a07]

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s

Here's my build.gradle file

buildscript {
    repositories {
        maven { url "https://repo1.maven.org/maven2" }
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.+'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
    }
}

plugins {
    id "com.jfrog.bintray" version "1.8.5"
}

apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'java'

group = 'com.projectx'
version = '0.0.1'

repositories {
    jcenter()
    mavenCentral()
}

sourceSets {
    main.java.srcDirs = ['src/main/java']
}

bintray {
    user = System.getenv('BINTRAY_USER')
    key = System.getenv('BINTRAY_KEY')
    publications = ['MyPublication']
    pkg {
        repo = 'maven'
        name = 'project-x'
        userOrg = 'myorg'
        licenses = ['Proprietary']
        vcsUrl = 'https://github.com/myorg/my-project.git'
        version {
            name = project.version
            released new Date()
        }
    }
}

publishing {
    publications {
        MyPublication(MavenPublication) {
            from components.java
            groupId project.group
            artifactId 'projectx'
            version project.version
        }
    }
}

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'jacoco'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

install {
    repositories.mavenInstaller {
        pom.artifactId = 'projectx'
    }
}

test {
    finalizedBy jacocoTestReport   // Report is always generated after tests run
}

jacocoTestReport {
    dependsOn test  // Tests are required to run before generating the report
    reports {
        xml.enabled true
    }
}

task execute(type:JavaExec) {
    main = System.getProperty('mainClass')
    classpath = sourceSets.main.runtimeClasspath
}

dependencies {
    compile 'io.swagger:swagger-annotations:1.5.22'
    compile "com.google.code.findbugs:jsr305:3.0.2"
    compile 'com.squareup.okhttp3:okhttp:3.14.2'
    compile 'com.squareup.okhttp3:logging-interceptor:3.14.2'
    compile 'com.google.code.gson:gson:2.8.5'
    compile 'io.gsonfire:gson-fire:1.8.3'
    compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
    testCompile 'junit:junit:4.13'
    testCompile 'org.mockito:mockito-core:3.+'
    testImplementation "com.google.truth:truth:1.0.1"
}

javadoc {
    options.tags = [ "http.response.details:a:Http Response Details" ]
}

1 Answers

Bintray is dead. But to answer the question, No signature of method: build_whatever.[method]() comes from something in the configuration of [method] being incorrect. In this case I'd guess it's caused by released new Date() which should probably be released = new Date()

Related