bintray / gradle-bintray-plugin

Apache License 2.0
1.28k stars 197 forks source link

Signature files produced by publishing plugin not uploaded #255

Open sdavids opened 6 years ago

sdavids commented 6 years ago

Setup:

plugins {
  id 'java-library'
  // ...
  id 'com.jfrog.bintray' version '1.8.4'
}

// ...

apply plugin: 'signing'
apply plugin: 'maven-publish'

task javadocJar(type: Jar, dependsOn: 'javadoc') {
  classifier = 'javadoc'
  from javadoc.destinationDir
}

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

artifacts {
  archives javadocJar, sourcesJar
}

publishing {
  publications {
    mavenJava(MavenPublication) {
      from components.java
      artifact sourcesJar
      artifact javadocJar
      pom {
        name = '...'
      }
    }
  }
}

signing {
  sign publishing.publications.mavenJava
}

bintray {
  user = '...'
  key = '...'
  publications = ['mavenJava']
  pkg {
    repo = '...'
    name = '...'
    licenses = ['...']
    vcsUrl = 'https://...'
  }
}

wrapper {
  gradleVersion = '4.10.2'
}

./gradlew clean publishToMavenLocal will place the 3 JARs, the POM, and the 4 signature files (*.asc) into the local maven repository—which is correct.

./gradlew clean bintrayUpload will place the 3 JARs, the POM, and the 4 signature files (*.asc) into the local maven repository (publishToMavenLocal called implicitly), but only upload the 3 JARs and the POM to bintray—which is incorrect.

sdavids commented 6 years ago

I came up with the following workaround:

bintray {
    // ...
    publications = ['mavenJava']
    filesSpec {
      from("${buildDir}/libs") {
        include '*.jar.asc'
      }
      from("${buildDir}/publications/mavenJava") {
        include 'pom-default.xml.asc'
        rename 'pom-default.xml.asc', "${project.name}-${project.version}.pom.asc"
      }
      into "${project.group.replaceAll(/\./, '/')}/${project.name}/${project.version}"
    }
    pkg {
      // ...
    }
  }
sdavids commented 6 years ago

But this should be handled by the plugin by default ...

InsanusMokrassar commented 5 years ago

@sdavids hello. Do you have solving of this problem?

technoir42 commented 5 years ago

Had the same problem, ended up removing gradle-bintray-plugin completely and just using this instead:

publishing {
    repositories {
        maven {
            name = 'bintray'
            url = 'https://api.bintray.com/maven/<owner>/<repo>/<pkg>/;publish=1'
            credentials {
                username = System.env['BINTRAY_USER']
                password = System.env['BINTRAY_KEY']
            }
        }
    }
}