Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to upload to bintray from subproject #329

Closed
stavshamir opened this issue Jun 25, 2020 · 3 comments
Closed

Fail to upload to bintray from subproject #329

stavshamir opened this issue Jun 25, 2020 · 3 comments

Comments

@stavshamir
Copy link

stavshamir commented Jun 25, 2020

Hello, I am trying to publish a jar produced by a subproject to bintray and it fails with the following error:

Execution failed for task ':springwolf-ui:bintrayUpload'.
> Cannot cast object 'task ':bintrayUpload'' with class 'com.jfrog.bintray.gradle.tasks.BintrayUploadTask_Decorated' to class 'com.jfrog.bintray.gradle.tasks.BintrayUploadTask'

When I create a new project with the exact same contents, the task does not fail.

This is the build.gradle:

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

version = rootProject.uiVersion
sourceCompatibility = 1.8

task sourcesJar(type: Jar) {
  classifier = 'sources'
  from sourceSets.main.allSource
}

artifacts {
  archives sourcesJar
}

def pomConfig = {
  licenses {
    license {
      name 'The Apache License, Version 2.0'
      url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
    }
  }

  developers {
    developer {
      id 'stavshamir'
      name 'Stav Shamir'
      email '[email protected]'
    }
  }

  scm {
    url 'https://github.com/stavshamir/springwolf'
  }
}

publishing {
  publications {
    mavenPublication(MavenPublication) {
      artifact jar

      artifact sourcesJar {
        classifier "sources"
      }

      groupId project.group
      artifactId 'springwolf-ui'
      version project.version
      pom.withXml {
        def root = asNode()
        root.appendNode('description', 'Automated JSON API documentation for Kafka Listeners built with Spring')
        root.appendNode('name', 'springwolf-ui')
        root.appendNode('url', 'https://github.com/stavshamir/springwolf')
        root.children().last() + pomConfig
      }
    }
  }
}

bintray {
  user = System.getProperty('bintray.user')
  key = System.getProperty('bintray.key')
  publications = ['mavenPublication']

  pkg {
    repo = 'springwolf'
    name = 'springwolf-ui'
    userOrg = 'stavshamir'
    licenses = ['Apache-2.0']
    vcsUrl = 'https://github.com/stavshamir/springwolf.git'
    version {
      name = project.version
      desc = 'Web UI for springwolf'
      released = new Date()
    }
  }
}

This is the repo: https://github.com/stavshamir/springwolf

@stavshamir stavshamir changed the title Fail to upload to bintray (1.8.5) Fail to upload to bintray from subproject Jun 28, 2020
@dubinsky
Copy link

@stavshamir this looks like a class-loader issue; there is a chance this may help...

@stavshamir
Copy link
Author

@dubinsky OMG, you solved it! Thanks a lot, this was driving me crazy

@dubinsky
Copy link

@stavshamir Glad it helped. It drove me crazy too :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants