Giter Site home page Giter Site logo

gradle-bintray-plugin's Introduction

Overview

The Gradle Bintray Plugin allows you to publish artifacts to Bintray.

Download

Table of Contents

Getting Started Using the Plugin
Building and Testing the Sources
Creating Repositories, Packages and Versions
GPG File Signing
Maven Central Sync
Plugin DSL
Example Projects
Building and Testing the Sources
Release Notes
Code Contributions
License

Please follow the below steps to add the Gradle Bintray Plugin to your Gradle build script.

Step 1: Sign up to Bintray and locate your API Key under Edit Your Profile -> API Key

Step 2: Apply the plugin to your Gradle build script

To apply the plugin, please add one of the following snippets to your build.gradle file:

Gradle >= 2.1
plugins {
    id "com.jfrog.bintray" version "1.+"
}
  • Currently the "plugins" notation cannot be used for applying the plugin for sub projects, when used from the root build script.
Gradle < 2.1
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.+'
    }
}
apply plugin: 'com.jfrog.bintray'
  • If you have a multi project build make sure to apply the plugin and the plugin configuration to every project which its artifacts you wish to publish to bintray.

Step 3: Add the bintray configuration closure to your build.gradle file

Add the below "bintray" closure with your bintray user name and key.

bintray {
    user = 'bintray_user'
    key = 'bintray_api_key'
    ...
}

In case you prefer not to have your Bintray credentials explicitly defined in the script, you can store them in environment variables or in external user properties and use them as follows:

bintray {
    user = System.getenv('BINTRAY_USER')
    key = System.getenv('BINTRAY_KEY')
    ...
}

Step 4: Add your Bintray package information to the bintray closure

Mandatory parameters:

  1. repo - existing repository in bintray to add the artifacts to (for example: 'generic', 'maven' etc)
  2. name - package name
  3. licenses - your package licenses (mandatory if the package doesn't exist yet and must be created, and if the package is an OSS package; optional otherwise)
  4. vcsUrl - your VCS URL (mandatory if the package doesn't exist yet and must be created, and if the package is an OSS package; optional otherwise)

Optional parameters:

  1. userOrg โ€“ an optional organization name when the repo belongs to one of the user's orgs. If not added will use 'BINTRAY_USER' by default
bintray {   
    user = 'bintray_user'
    key = 'bintray_api_key'
    pkg {
        repo = 'generic'
        name = 'gradle-project'
        userOrg = 'bintray_user'
        licenses = ['Apache-2.0']
        vcsUrl = 'https://github.com/bintray/gradle-bintray-plugin.git'
    }
}

Step 5: If you're uploading a Debian package, configure its details

If your Gradle build deploys a Debian package to a Debian repository, you need to specify the Distribution, Component and Architecture for the package. You do this by adding the debian closure into the pkg closure.

    pkg {
        repo = 'generic'
        name = 'gradle-project'
        userOrg = 'bintray_user'
        licenses = ['Apache-2.0']
        vcsUrl = 'https://github.com/bintray/gradle-bintray-plugin.git'
        debian {
            distribution = 'squeeze'
            component = 'main'
            architecture = 'i386,noarch,amd64'
        }
    }

The component property is optional and has main as its default value.

Step 6: Add version information to the pkg closure

Mandatory parameters:

  1. name - Version name

Optional parameters:

  1. desc - Version description
  2. released - Date of the version release. Can accept one of the following formats:
    • Date in the format of 'yyyy-MM-dd'T'HH:mm:ss.SSSZZ'
    • java.util.Date instance
  3. vcsTag - Version control tag name
  4. attributes - Attributes to be attached to the version
pkg {
    version {
        name = '1.0-Final'
        desc = 'Gradle Bintray Plugin 1.0 final'
        released  = new Date()
        vcsTag = '1.3.0'
        attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin']
    }
}

Step 7: Define artifacts to be uploaded to Bintray

The plugin supports three methods to create groups of artifacts: Configurations, Publications and Copying specific files using filesSpec. One of the methods should be used to group artifacts to be uploaded to Bintray. Using the Configurations approach is the easiest, since this option attempts to infer what artifacts to upload based on the Gradle project and dependencies that are defined. Publications gives more fine-grained control, especially when needing to publish metadata for publishing to Maven Central. Copying specific files can be used as a last option, which provides the ability to define custom rules using the Gradle's CopySpec task. In general, the first two options should be sufficient for your needs.

  • Maven Publications should be added to the Gradle script, outside of the bintray closure. They should however be referenced from inside the bintray closure.
  • Applying the maven-publish plugin is required when using Maven Publications.
  • To avoid this issue, which can cause transitive dependencies of your published artifacts not to be included, make sure to apply the java-library plugin to your build script. Applying the plugin resolves the issue for Gradle version 3.4 and above. For Gradle versions below 3.4, you can use this workaround.
  • Ivy Publications are not supported.

Below you can find an example for Maven Publication that can be added to your Gradle script:

publishing {
    publications {
        MyPublication(MavenPublication) {
            from components.java
            groupId 'org.jfrog.gradle.sample'
            artifactId 'gradle-project'
            version '1.1'
        }
    }
}

Here's another publication example, which adds sourcesJar, javadocJar and configures the generated pom.xml. You need the sourcesJar in case you'd like your package to be linked to JCenter. In case you'd also like Bintray to sync your package to Maven Central, you'll need sourcesJar, javadocJar and the generated pom.xml must comply with Maven Central's requirements.

// Create the pom configuration:
def pomConfig = {
    licenses {
        license {
            name "The Apache Software License, Version 2.0"
            url "http://www.apache.org/licenses/LICENSE-2.0.txt"
            distribution "repo"
        }
    }
    developers {
        developer {
            id "developer-id"
            name "developer-name"
            email "[email protected]"
        }
    }
    
    scm {
       url "https://github.com/yourgithubaccount/example"
    }
}

// Create the publication with the pom configuration:
publishing {
    publications {
        MyPublication(MavenPublication) {
            from components.java
            artifact sourcesJar
            artifact javadocJar
            groupId 'org.jfrog.gradle.sample'
            artifactId 'gradle-project'
            version '1.1'
            pom.withXml {
                def root = asNode()
                root.appendNode('description', 'Your description of the lib')
                root.appendNode('name', 'Your name of the lib')
                root.appendNode('url', 'https://site_for_lib.tld')
                root.children().last() + pomConfig
            }
        }
    }
}

If you are trying to publish an Android project, specifying the from components.java line in the above example is not applicable. Also, the POM file generated does not include the dependency chain so it must be explicitly added using this workaround.

publishing {
    publications {
        MyPublication(MavenPublication) {
          // Define this explicitly if using implementation or api configurations
          pom.withXml {
            def dependenciesNode = asNode().getAt('dependencies')[0] ?: asNode().appendNode('dependencies')
          
            // Iterate over the implementation dependencies (we don't want the test ones), adding a <dependency> node for each
            configurations.implementation.allDependencies.each {
               // Ensure dependencies such as fileTree are not included.
               if (it.name != 'unspecified') {
                  def dependencyNode = dependenciesNode.appendNode('dependency')
                  dependencyNode.appendNode('groupId', it.group)
                  dependencyNode.appendNode('artifactId', it.name)
                  dependencyNode.appendNode('version', it.version)
               }
            }
          }
        }
    }
}     

The Publication should be referenced from the bintray closure as follows:

bintray {
    user = 'bintray_user'
    key = 'bintray_api_key' 
    publications = ['MyPublication'] 
}

Configurations should be added to the Gradle script, outside of the bintray closure. They should however be referenced from inside the bintray closure.

The following example uses the archives Configuration by applying the java plugin:

apply plugin: 'java'

and the Configuration should be referenced from the bintray closure as follows:

bintray {
    user = 'bintray_user'
    key = 'bintray_api_key' 
    configurations = ['archives']
}
Copying specific files using filesSpec

FilesSpec is following Gradle's CopySpec which is used by the copy task.

Below you can find an example for uploading arbitrary files from a specific folder ('build/libs') to a directory ('standalone_files/level1') under the build version in bintray using filesSpec.

bintray {
    user = 'bintray_user'
    key = 'bintray_api_key'
    filesSpec {
       from 'build/libs'
       into 'standalone_files/level1'
    }
}

Step 8: Run the build

gradle bintrayUpload

General

  • When uploading files to Bintray, you need to specify the Repository, Package and Version to which files are uploaded. The plugin checks whether the specified Package already exists in the specified Repository. If the specified Package does not exist, the plugin will create it. The same is done for the specified version, so you don't need to worry about having your builds deploy your artifacts into new Packages and Versions. The plugin, however, expects the Repository to exist already and the plugin will not try to create the Repository if it does not exist.
  • The plugin uses the specified Package and Version details, for example, the Package VCS URL, only for creating the Package and Version. The plugin will not attempt to update those properties if the Package or Version already exist.

Mandatory properties

  • For the pkg closure, if the package already exists, the only mandatory properties are repo and name. If the package does not exist, the licenses and *vcsUrl properties are manadatory for OSS packages.
  • For the version closure, the only mandatory property is name.

The plugin allows using Bintray supports for files GPG signing. To have your Version files signed by Bintray, you first need to configure your public and private GPG keys in Bintray, and then add the gpg closure inside the version closure as shown in the below Plugin DSL section. If your GPG keys are not configured in Bintray and sign is true, then the files will be signed using Bintray's internal keys.

The plugin allows using Bintray's interface with Maven Central. You can have the artifacts of a Version sent to Maven Central, by adding the adding the mavenCentralSync closure inside the version closure, as shown in the below Plugin DSL section. If that closure is omitted, the version will not be sent to Maven central.

In order for this functionality to be enabled, you first must verify the following:

  • The Version belongs to a Repository whose type is Maven and the Version belongs to a Package that is included in JCenter.
  • Your package must comply with the requirement of Maven Central (click here for more information). In particular, sourcesJar, javadocsJar and valid pom.xml must be included (see above); also files must be signed to be sent to Maven Central, so GPG file signing should be enabled (see above) if Maven Central sync is enabled.

The Gradle Bintray plugin can be configured using its own Convention DSL inside the build.gradle script of your root project. The syntax of the Convention DSL is described below:

build.gradle

bintray {
    user = 'bintray_user'
    key = 'bintray_api_key'
    
    configurations = ['deployables'] //When uploading configuration files
    // - OR -
    publications = ['mavenStuff'] //When uploading Maven-based publication files
    // - AND/OR -
    filesSpec { //When uploading any arbitrary files ('filesSpec' is a standard Gradle CopySpec)
        from 'arbitrary-files'
        into 'standalone_files/level1'
        rename '(.+)\\.(.+)', '$1-suffix.$2'
    }
    dryRun = false //[Default: false] Whether to run this as dry-run, without deploying
    publish = true //[Default: false] Whether version should be auto published after an upload    
    override = false //[Default: false] Whether to override version artifacts already published    
    //Package configuration. The plugin will use the repo and name properties to check if the package already exists. In that case, there's no need to configure the other package properties (like userOrg, desc, etc).
    pkg {
        repo = 'myrepo'
        name = 'mypkg'
        userOrg = 'myorg' //An optional organization name when the repo belongs to one of the user's orgs
        desc = 'what a fantastic package indeed!'
        websiteUrl = 'https://github.com/bintray/gradle-bintray-plugin'
        issueTrackerUrl = 'https://github.com/bintray/gradle-bintray-plugin/issues'
        vcsUrl = 'https://github.com/bintray/gradle-bintray-plugin.git'
        licenses = ['Apache-2.0']
        labels = ['gear', 'gore', 'gorilla']
        publicDownloadNumbers = true
        attributes= ['a': ['ay1', 'ay2'], 'b': ['bee'], c: 'cee'] //Optional package-level attributes

        githubRepo = 'bintray/gradle-bintray-plugin' //Optional Github repository
        githubReleaseNotesFile = 'README.md' //Optional Github readme file

        //Optional Debian details
        debian {
            distribution = 'squeeze'
            component = 'main'
            architecture = 'i386,noarch,amd64'
        }
        //Optional version descriptor
        version {
            name = '1.3-Final' //Bintray logical version name
            desc = //Optional - Version-specific description'
            released  = //Optional - Date of the version release. 2 possible values: date in the format of 'yyyy-MM-dd'T'HH:mm:ss.SSSZZ' OR a java.util.Date instance
            vcsTag = '1.3.0'
            attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin'] //Optional version-level attributes
            //Optional configuration for GPG signing
            gpg {
                sign = true //Determines whether to GPG sign the files. The default is false
                passphrase = 'passphrase' //Optional. The passphrase for GPG signing'
            }
            //Optional configuration for Maven Central sync of the version
            mavenCentralSync {
                sync = true //[Default: true] Determines whether to sync the version to Maven Central.
                user = 'userToken' //OSS user token: mandatory
                password = 'paasword' //OSS user password: mandatory
                close = '1' //Optional property. By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off (by puting 0 as value) and release the version manually.
            }            
        }
    }
}

Gradle Compatibility: When using Gradle publications or when using filesSpec for direct file uploads, you'll need to use Gradle 2.x; Otherwise, the plugin is compatible with Gradle 1.12 and above.

JVM Compatibility: Java 6 and above.

As an example, you can also refer to these sample projects.

You can use the -P command line option to pass user and key as command line argument:

gradle -Puser=someuser -Pkey=ASDFASDFASDF bintrayUpload

then you need to use those properties in your config:

bintray {
    user = property('user')
    key = property('key')
}

The code is built using Gradle and includes integration tests. The tests use real repositories in your Bintray organization.

Before running the tests

Make sure you have the following repositories in your Bintray organization:

  • A Maven repository named maven.
  • A Debian repository named debian. Also, the following environment variable should be set:
export BINTRAY_USER=<Your Bintray user name>
export BINTRAY_KEY=<Your Bintray API Key>
export BINTRAY_ORG=<Your Bintray organization name>

Running the build with or without tests

To build the code using the gradle wrapper in Unix run:

> ./gradlew clean build

To build the code using the gradle wrapper in Windows run:

> gradlew clean build

To build the code using the environment gradle run:

> gradle clean build

To build the code without running the tests, add to the "clean build" command the "-x test" option, for example:

> ./gradlew clean build -x test

The release notes are available on Bintray.

We welcome code contributions through pull requests. Please join our contributors community and help us make this plugin even better!

This plugin is available under the Apache License, Version 2.0.

(c) All rights reserved JFrog

gradle-bintray-plugin's People

Contributors

aalmiray avatar alexeivainshtein avatar artem-zinnatullin avatar astrakhantsev avatar dcrichards avatar dreis2211 avatar enr avatar eyalb4doc avatar eyalbe4 avatar friederbluemle avatar hierynomus avatar hkhc avatar jbaruch avatar jnizet avatar kaitoy avatar kaklakariada avatar ldaley avatar ming13 avatar mkobit avatar rm3l avatar rogerhu avatar shikloshi avatar szpak avatar turansky avatar vedavyasbhat avatar warnyul avatar wmora avatar xvik avatar yoav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gradle-bintray-plugin's Issues

New property "filesSpec" does not work as advertised

Upgraded a sample project to gradle-bintra-plugin-0.6 and gave a try to this new property. Sadly the results are not favorable.

First, the documentation states that filesSpec is a of type CopySpec so the following configuration should work, shouldn't it?

filesSpec {
    into [project.group.replace('.' as char, '/' as char), "${pluginBaseName}-plugin", project.version].join('/')
    from generateBom.outputDir
}

However I get the following error

* What went wrong:
A problem occurred evaluating script.
> Could not find property 'into' on task ':_bintrayRecordingCopy'.

* Try:
Run with --debug option to get more log output.

* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating script.
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:187)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyScript(DefaultObjectConfigurationAction.java:98)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$000(DefaultObjectConfigurationAction.java:36)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$1.run(DefaultObjectConfigurationAction.java:67)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:130)
    at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:41)
    at org.gradle.api.Project$apply$0.call(Unknown Source)
    at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)
    at org.gradle.api.Script$apply$0.callCurrent(Unknown Source)
    at build_3s61i66g3ccm6fm1vcg9q20a1l.run(/Users/aalmiray/dev/github/griffon-plugins/griffon-crystalicons-plugin/build.gradle:27)
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:187)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:39)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:470)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:79)
    at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:31)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:128)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:105)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:85)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:81)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:39)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:45)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:35)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAndStop.java:33)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.ReturnResult.execute(ReturnResult.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:71)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:69)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:69)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:60)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:45)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator.runCommand(DaemonStateCoordinator.java:184)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy.doBuild(StartBuildOrRespondWithBusy.java:49)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.HandleStop.execute(HandleStop.java:30)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.DaemonHygieneAction.execute(DaemonHygieneAction.java:39)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.CatchAndForwardDaemonFailure.execute(CatchAndForwardDaemonFailure.java:32)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.DefaultDaemonCommandExecuter.executeCommand(DefaultDaemonCommandExecuter.java:51)
    at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.handleCommand(DefaultIncomingConnectionHandler.java:155)
    at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.receiveAndHandleCommand(DefaultIncomingConnectionHandler.java:128)
    at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.run(DefaultIncomingConnectionHandler.java:116)
    at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
Caused by: groovy.lang.MissingPropertyException: Could not find property 'into' on task ':_bintrayRecordingCopy'.
    at org.gradle.api.internal.AbstractDynamicObject.propertyMissingException(AbstractDynamicObject.java:43)
    at org.gradle.api.internal.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:35)
    at org.gradle.api.internal.CompositeDynamicObject.getProperty(CompositeDynamicObject.java:94)
    at com.jfrog.bintray.gradle.RecordingCopyTask_Decorated.getProperty(Unknown Source)
    at bom_7mt66ech0t7p2t4o7p1j3qiio2$_run_closure2_closure3.doCall(/Users/aalmiray/dev/github/griffon-plugins/griffon-crystalicons-plugin/gradle/bom.gradle:42)
    at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:59)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:130)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:110)
    at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:473)
    at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:58)
    at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:51)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:130)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:91)
    at org.gradle.util.ConfigureUtil$configure.call(Unknown Source)
    at com.jfrog.bintray.gradle.BintrayExtension.filesSpec(BintrayExtension.groovy:38)
    at com.jfrog.bintray.gradle.BintrayExtension_Decorated.filesSpec(Unknown Source)
    at bom_7mt66ech0t7p2t4o7p1j3qiio2$_run_closure2.doCall(/Users/aalmiray/dev/github/griffon-plugins/griffon-crystalicons-plugin/gradle/bom.gradle:41)
    at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:59)
    at org.gradle.api.internal.plugins.ExtensionsStorage$ExtensionHolder.configure(ExtensionsStorage.java:145)
    at org.gradle.api.internal.plugins.ExtensionsStorage.configureExtension(ExtensionsStorage.java:69)
    at org.gradle.api.internal.plugins.DefaultConvention$ExtensionsDynamicObject.invokeMethod(DefaultConvention.java:207)
    at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
    at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java:79)
    at bom_7mt66ech0t7p2t4o7p1j3qiio2.run(/Users/aalmiray/dev/github/griffon-plugins/griffon-crystalicons-plugin/gradle/bom.gradle:36)
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
    ... 64 more

Also, it seems to me that filesSpec is not used at all by BintrayUploadTask as evidenced by https://github.com/bintray/gradle-bintray-plugin/blob/master/src/main/groovy/com/jfrog/bintray/gradle/BintrayUploadTask.groovy#L176

Pre-Upload Checks

Please add a way to supply a closure that receives the project and configured bintray task so one can do some checks before uploading, allowing to abort the process. My use case would be to prevent uploading versions that match a certain criteria such as ending in '-SNAPSHOT'.

Bintray plugin 0.4 only runs with JDK8 (requires class Spliterator)

Caused by: java.lang.NoClassDefFoundError: java/util/Spliterator
at groovyx.net.http.EncoderRegistry.buildDefaultEncoderMap(EncoderRegistry.java:349)
at groovyx.net.http.EncoderRegistry.(EncoderRegistry.java:91)
at com.jfrog.bintray.gradle.BintrayHttpClientFactory$1.(BintrayHttpClientFactory.groovy)
at com.jfrog.bintray.gradle.BintrayHttpClientFactory.create(BintrayHttpClientFactory.groovy:25)
at com.jfrog.bintray.gradle.BintrayHttpClientFactory$create.call(Unknown Source)
at com.jfrog.bintray.gradle.BintrayUploadTask.bintrayUpload(BintrayUploadTask.groovy:145)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:570)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:553)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 66 more

bintrayUpload does not depend on "publish${publication}PublicationToMavenLocal"

Somehow I expected, that calling bintrayUpload, would build the artifacts it needs to upload. But it didn't. Digging a bit and I figured that the bintrayUpload task does not depend on its publications. It only depends on the pom generation task. The relevant line in the plugin:

def taskName = generatePomFileFor${it[0].toUpperCase()}${it.substring(1)}Publication"
Task publishToLocalTask = project.tasks.findByName(taskName)
bintrayUpload.dependsOn(publishToLocalTask)

Is this a mistake? The variable name publishToLocalTask seems to support this theory.

As a workaround I did:

bintrayUpload {
    dependsOn "publishMavenJavaPublicationToMavenLocal"
}

Can't Sign Archives

I'm getting these errors when I updated the plugin from 0.5 to 1.0

Could not find method gpg() for arguments [build_7tam9m3nisbcua90z6diut4yw$_run_closure3_closure12_closure14@3f78aa8c] on com.jfrog.bintray.gradle.BintrayExtension_Decorated@24dc7c05.

Could not find method mavenCentralSync() for arguments [build_7tam9m3nisbcua90z6diut4yw$_run_closure3_closure12_closure14@6147c8d1] on com.jfrog.bintray.gradle.BintrayExtension_Decorated@781d8448

Is this some problem with gradle not updating the plugin or something?

Issue descriptive error on upload problems

A newbie problem: I tried to publish a new maven artifact, Gradle finished with a BUILD SUCCESSFUL message, but no files appeared. After turning on additional Gradle logging, I discovered that the file uploads were logged with HTTP/1.1 400 Bad Request. In the end, I found out that the problem was the version number - snapshot versions result in the 400 error. So the bug report is twofold:

  • When uploads fail, let the build target fail (instead of silently discarding the problem)
  • Show a descriptive error message on the problem (in this case: Explain that snapshot versions are not accepted)

Publish after upload

I'm writing an automated release process using this plugin. The package and version are created, and the files are uploaded. But they're stuck in an unpublished state. Did I miss something in this plugin? Is this just not done yet? Is it expected to always be a manual step? I started to write a doLast to do the publish, but there's a lot of private fields which make it hard to run from my build.

        HTTPBuilder http = bintrayUpload.createHttpClient()
        def repoPath = "${userOrg ?: user}/$repoName"
        def uploadUri = "/content/$repoPath/$packageName/$version/publish"
        http.request(POST, JSON) {
            uri.path = uploadUri
            body = [discard: 'false']

            response.success = { resp ->
                logger.info("Published package $packageName.")
            }
            response.failure = { resp ->
                throw new GradleException("Could not publish package $packageName")
            }
        }

Support githubRepo property in configuration

Same as websiteUrl and vcsUrl, it would be great if githubRepo could be specified programmatically. Otherwise developers have to manually edit the package to add this value. Additionally, if this value is set it would also be great to turn on the README from github (with a boolean flag).

Version 0.2 doesn't work with Gradle 1.7

$ ./gradlew tasks --stacktrace

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/dmitrygusev/dev/workspaces/anjlab/anjlab-tapestry-commons/build.gradle' line: 67

* What went wrong:
A problem occurred evaluating root project 'anjlab-tapestry-commons'.
> No signature of method: com.jfrog.bintray.gradle.BintrayPlugin.dependsOn() is applicable for argument types: (org.gradle.api.internal.tasks.DefaultTaskCollection_Decorated) values: [[task ':bintrayUpload']]

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'anjlab-tapestry-commons'.
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:127)
    at org.gradle.configuration.BuildScriptProcessor.execute(BuildScriptProcessor.java:36)
    at org.gradle.configuration.BuildScriptProcessor.execute(BuildScriptProcessor.java:23)
    at org.gradle.configuration.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
    at org.gradle.configuration.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:465)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:76)
    at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:31)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:45)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:42)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAndStop.java:33)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.ReturnResult.execute(ReturnResult.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:70)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:68)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:68)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:59)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:45)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator.runCommand(DaemonStateCoordinator.java:186)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy.doBuild(StartBuildOrRespondWithBusy.java:49)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.HandleStop.execute(HandleStop.java:36)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.CatchAndForwardDaemonFailure.execute(CatchAndForwardDaemonFailure.java:32)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
    at org.gradle.launcher.daemon.server.exec.DefaultDaemonCommandExecuter.executeCommand(DefaultDaemonCommandExecuter.java:48)
    at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.handleCommand(DefaultIncomingConnectionHandler.java:155)
    at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.receiveAndHandleCommand(DefaultIncomingConnectionHandler.java:128)
    at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.run(DefaultIncomingConnectionHandler.java:116)
    at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
Caused by: groovy.lang.MissingMethodException: No signature of method: com.jfrog.bintray.gradle.BintrayPlugin.dependsOn() is applicable for argument types: (org.gradle.api.internal.tasks.DefaultTaskCollection_Decorated) values: [[task ':bintrayUpload']]
    at com.jfrog.bintray.gradle.BintrayPlugin$_apply_closure2.doCall(BintrayPlugin.groovy:31)
    at com.jfrog.bintray.gradle.BintrayPlugin.apply(BintrayPlugin.groovy:28)
    at com.jfrog.bintray.gradle.BintrayPlugin.apply(BintrayPlugin.groovy)
    at org.gradle.api.internal.plugins.DefaultPluginContainer.providePlugin(DefaultPluginContainer.java:107)
    at org.gradle.api.internal.plugins.DefaultPluginContainer.addPluginInternal(DefaultPluginContainer.java:71)
    at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:37)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:101)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:32)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:72)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)
    at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:39)
    at org.gradle.api.Project$apply.call(Unknown Source)
    at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)
    at org.gradle.api.Script$apply.callCurrent(Unknown Source)
    at build_2qbsa88n633nfbn2o1h988l6s7.run(/Users/dmitrygusev/dev/workspaces/anjlab/anjlab-tapestry-commons/build.gradle:67)
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
    ... 51 more


BUILD FAILED

Total time: 4.312 secs

Build file '/Users/dmitrygusev/dev/workspaces/anjlab/anjlab-tapestry-commons/build.gradle' line: 67

is: apply plugin: 'bintray'

Here's what I've added to the bottom of my build.gradle:

(This is a multi-module project and I added this to the parent build.gradle)

buildscript {
    repositories {
        maven { url 'http://jcenter.bintray.com' }
        mavenLocal()
    }
    dependencies {
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.2'
    }
}

apply plugin: 'bintray'

bintray {
    user = $System.env.bintray_user
    key = $System.env.bintray_api_key
    configurations = ['deployables']
    publications = ['mavenStuff']
    pkg {
        repo = 'myrepo'
        userOrg = 'myorg' // an optional organization name when the repo belongs to one of the user's orgs
        name = 'mypkg'
        desc = 'a fantastic package, indeed!'
        licenses = ['Apache-2.0']
        labels = ['gear', 'gore', 'gorilla']
    }
    dryRun = dry // whether to run this as dry-run, without deploying
}

turn my bintray tasks into a plugin

So I have been meaning to turn my bintray gradle tasks here into a plugin. It is pretty hacky right now, but it works. If you are serious about writing this, I could try to construct the upload part of your plugin and send a pull request. Otherwise I will just create my own. There is also a bintray gradle plugin on bitbucket here. That plugin seemed more concerned with basic GET interaction with bintray. I don't think anything exists for publishing.

enabling 'dryRun' and 'publish' together yields exception

Enabling 'dryRun' and 'publish' together yields 404 error (presumably because the version does not exists and it was not created because of dryRun)

dryRun = true
publish = true

It would be nice to either treat both options set to 'true' as invalid input or to make it behaving.

Anyhow, bintray plugin is really nice :) Thanks for sharing.

avoid creation of a new version if it is binary equal with the latest version

Hey,

It would be awesome if there was some way to configure bintray plugin to avoid uploading a new version if latest version is binary the same.

My use case is continuous deployment of Mockito. I'm already pushing new minor version for every successful build after every push. However, sometimes I just push some changes to the project that do not incur any changes to the binaries that are published.

Anyhow, I'll implement this myself in Mockito build - just wanted to give heads up that some support for this would very useful :)

Thanks guys for bintray!

Allow linking to jcenter

It would be great if the upload task had an option to link the package to JCenter. Perhaps it only makes sense for newly created packages. Maybe extend this feature so that it can link to any repository too.

Generic repository support

Maven deployment works fine, but I'm unable to find a way to upload binaries into a Generic repository.
Thanks,

Lightweight Bintray API

It would be great if the plugin exposed (perhaps just a subset) of the Bintray REST API using a helper class (i.e, Bintray). Here are some simple use cases:

  • sign a version whose artifacts have been uploaded manually
  • grab latest version for any package in order to include it in a document or make it an input of another task

Allow upload of latest version to already created bintray package

Hi,

I have created a package on bintray already - but it seems that the gradle plugin requires that I enter all the package config info (i.e. Licences etc) here as well. Am I missing something? I expected I would need to add my bintray user pass and the bintray package id/name and then the bintrayUpload task would

  • build
  • create pom including gradle dependencies
  • sign
  • upload

Am I missing the config that allows you to not enter the duplicate information?

Also the bintray block requires the version name to be entered which is also already in the gradle file?

Thx

EDIT: ah i see the package creation is optional

Version 0.4 does not work with Gradle 1.x

The Griffon build has been fully tested with Gradle 1.12 so far. We recently upgraded to gradle-bintray-plugin 0.4 and found the following error

* What went wrong:
A problem occurred evaluating script.
> org/codehaus/groovy/runtime/typehandling/ShortTypeHandling

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating script.
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:152)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyScript(DefaultObjectConfigurationAction.java:97)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$000(DefaultObjectConfigurationAction.java:36)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$1.run(DefaultObjectConfigurationAction.java:67)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:129)
    at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:41)
    at org.gradle.api.Project$apply.call(Unknown Source)
    at build_31k93rrdduh8hdqbbknfbg3kg$_run_closure3_closure9.doCall(/Users/aalmiray/dev/github/griffon/build.gradle:150)
    at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:58)
    at org.gradle.internal.Actions$FilteredAction.execute(Actions.java:203)
    at org.gradle.listener.ActionBroadcast.execute(ActionBroadcast.java:39)
    at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:164)
    at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:159)
    at org.gradle.api.internal.plugins.DefaultPluginContainer.addPluginInternal(DefaultPluginContainer.java:69)
    at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:38)
    at org.gradle.api.plugins.GroovyPlugin.apply(GroovyPlugin.java:35)
    at org.gradle.api.plugins.GroovyPlugin.apply(GroovyPlugin.java:30)
    at org.gradle.api.internal.plugins.DefaultPluginContainer.providePlugin(DefaultPluginContainer.java:104)
    at org.gradle.api.internal.plugins.DefaultPluginContainer.addPluginInternal(DefaultPluginContainer.java:68)
    at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:34)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:116)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:36)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:85)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:129)
    at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:41)
    at org.gradle.api.Project$apply.call(Unknown Source)
    at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)
    at org.gradle.api.Script$apply.callCurrent(Unknown Source)
    at gradle_griffon_plugin_3p1he8q6kgv4rhkckkllgsn3n5.run(/Users/aalmiray/dev/github/griffon/subprojects/gradle-griffon-plugin/gradle-griffon-plugin.gradle:17)
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:152)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:40)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:493)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:80)
    at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:31)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    at org.gradle.launcher.Main.doAction(Main.java:46)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.Main.main(Main.java:37)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
Caused by: java.lang.NoClassDefFoundError: org/codehaus/groovy/runtime/typehandling/ShortTypeHandling
    at com.jfrog.bintray.gradle.BintrayExtension.this$dist$get$1(BintrayExtension.groovy)
    at com.jfrog.bintray.gradle.BintrayExtension$PackageConfig.propertyMissing(BintrayExtension.groovy)
    at com.jfrog.bintray.gradle.BintrayExtension$PackageConfig.getProperty(BintrayExtension.groovy)
    at publish_3buvst43f4k0a09iktmqquru32$_run_closure4_closure21.doCall(/Users/aalmiray/dev/github/griffon/gradle/publish.gradle:128)
    at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:58)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:130)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:91)
    at org.gradle.util.ConfigureUtil$configure.call(Unknown Source)
    at com.jfrog.bintray.gradle.BintrayExtension.pkg(BintrayExtension.groovy:31)
    at com.jfrog.bintray.gradle.BintrayExtension_Decorated.pkg(Unknown Source)
    at publish_3buvst43f4k0a09iktmqquru32$_run_closure4.doCall(/Users/aalmiray/dev/github/griffon/gradle/publish.gradle:116)
    at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:58)
    at org.gradle.api.internal.plugins.ExtensionsStorage$ExtensionHolder.configure(ExtensionsStorage.java:145)
    at org.gradle.api.internal.plugins.ExtensionsStorage.configureExtension(ExtensionsStorage.java:69)
    at org.gradle.api.internal.plugins.DefaultConvention$ExtensionsDynamicObject.invokeMethod(DefaultConvention.java:213)
    at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
    at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java:79)
    at publish_3buvst43f4k0a09iktmqquru32.run(/Users/aalmiray/dev/github/griffon/gradle/publish.gradle:110)
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
    ... 60 more
Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.runtime.typehandling.ShortTypeHandling
    ... 79 more

Upgrading to Gradle 2.0-rc-2 solves the problem. this means version 0.4 cannot be used with older versions of Gradle. Please document this fact if the new baseline should be Gradle 2.x; otherwise please fix the incompatibility (it appears to be caused by Groovy 2.x). ๐Ÿ˜„

Exception inside pkg block

The pkg block throws an exception if the project script variable is used to reference properties available in the project. In other words, this

bintray {
    user = project.bintrayUsername
    key = project.bintrayApiKey
    publications = ['mavenCustom']
    pkg {
        repo = project.bintrayRepo
        userOrg = project.bintrayOrg
        name = project.name
        desc = project.description
        licenses = ['Apache-2.0']
        labels = ['']
    }
}

leads to

* What went wrong:
A problem occurred evaluating script.
> No such field: project for class: com.jfrog.bintray.gradle.BintrayExtension_Decorated

Problem encountered with version 0.3 of the bintray plugin and

------------------------------------------------------------
Gradle 1.11
------------------------------------------------------------

Build time:   2014-02-11 11:34:39 UTC
Build number: none
Revision:     a831fa866d46cbee94e61a09af15f9dd95987421

Groovy:       1.8.6
Ant:          Apache Ant(TM) version 1.9.2 compiled on July 8 2013
Ivy:          2.2.0
JVM:          1.7.0_51 (Oracle Corporation 24.51-b03)
OS:           Mac OS X 10.9.2 x86_64

clean clone of the project does not build

When I clone vanilla repo, "./gradlew build" fails. It would be nice if it worked out of the box.

Build file '/Users/sfaber/mockito/gradle-bintray-plugin/build.gradle' line: 99

* What went wrong:
A problem occurred evaluating root project 'gradle-bintray-plugin'.
> Could not find property 'bintrayUser' on com.jfrog.bintray.gradle.BintrayExtension_Decorated@404eca05.

Client-side generated signatures are handled incorrectly

The path name of signatures is based on their corresponding artifact. However bintrayUpload currently uses some home-grown information container which looses this information. Hence the signature path name is created incorrectly and the signatures for different files conflict and overwrite each other. See below for a transcript.

Uploading to https://api.bintray.com/content/kotarak/kotkade/gradle-plugin/1.4.0/de/kotka/gradle/gradle-plugin/1.4.0/gradle-plugin-1.4.0.jar...
Uploaded to 'https://api.bintray.com/content/kotarak/kotkade/gradle-plugin/1.4.0/de/kotka/gradle/gradle-plugin/1.4.0/gradle-plugin-1.4.0.jar'.
Uploading to https://api.bintray.com/content/kotarak/kotkade/gradle-plugin/1.4.0/de/kotka/gradle/gradle-plugin/1.4.0/gradle-plugin-1.4.0.pom...
Uploaded to 'https://api.bintray.com/content/kotarak/kotkade/gradle-plugin/1.4.0/de/kotka/gradle/gradle-plugin/1.4.0/gradle-plugin-1.4.0.pom'.
Uploading to https://api.bintray.com/content/kotarak/kotkade/gradle-plugin/1.4.0/de/kotka/gradle/gradle-plugin/1.4.0/gradle-plugin-1.4.0.asc...
Uploaded to 'https://api.bintray.com/content/kotarak/kotkade/gradle-plugin/1.4.0/de/kotka/gradle/gradle-plugin/1.4.0/gradle-plugin-1.4.0.asc'.
Uploading to https://api.bintray.com/content/kotarak/kotkade/gradle-plugin/1.4.0/de/kotka/gradle/gradle-plugin/1.4.0/gradle-plugin-1.4.0.asc...
Uploaded to 'https://api.bintray.com/content/kotarak/kotkade/gradle-plugin/1.4.0/de/kotka/gradle/gradle-plugin/1.4.0/gradle-plugin-1.4.0.asc'.

Binary url schema change affect gradle build

it seems all my gradle plugins reply on bintray has been broken, though I'm not sure it's controlled by this plugin, I think you guys might know what's going on.

e.g. I have logs like:

Failed to get resource: GET. [HTTP HTTP/1.1 500 Internal Server Error: https://jcenter.bintray.com/com/github/jnr/jnr-x86asm/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 500 Internal Server Error: http://plugins.gradle.org/m2/com/github/jnr/jnr-x86asm/maven-metadata.xml]

https://jcenter.bintray.com/com/github/jnr/jnr-x86asm/maven-metadata.xml

Support Updates to Package Metadata

This plugin provides a lot of nice options for package metadata, but it will only use it if the package doesn't exist yet. For people that come to this plugin after creating a package or don't configure it right until later, the package never gets updated.

It would be nice to have it call the update if the package already exists. Maybe make it optional, if that would be surprising to some people.

https://bintray.com/docs/api.html#_update_package

My uploads are failing with a 400 Bad Request

Any thoughts on what could cause this?

My config:

bintray {
    user = project.bintrayUser
    key = project.bintrayKey
    publications = ['main']
    pkg {
        repo = 'libraries'
        name = 'grgit'
        desc = 'Groovy wrapper over JGit'
        licenses = ['Apache-2.0']
        labels = ['groovy', 'git']
    }
}

My output:

:bintrayUpload (Thread[main,5,main]) started.
:bintrayUpload
Executing task ':bintrayUpload' (up-to-date check took 0.0 secs) due to:
  Task has not declared any outputs.
Found 0 configuration(s) to publish.
Uploading to https://api.bintray.com/content/ajoberstar/libraries/grgit/0.1.0-SNAPSHOT/org/ajoberstar/grgit/0.1.0-SNAPSHOT/grgit-0.1.0-SNAPSHOT.jar...
Could not upload to https://api.bintray.com/content/ajoberstar/libraries/grgit/0.1.0-SNAPSHOT/org/ajoberstar/grgit/0.1.0-SNAPSHOT/grgit-0.1.0-SNAPSHOT.jar: HTTP/1.1 400 Bad Request
Uploading to https://api.bintray.com/content/ajoberstar/libraries/grgit/0.1.0-SNAPSHOT/org/ajoberstar/grgit/0.1.0-SNAPSHOT/grgit-0.1.0-SNAPSHOT-sources.jar...
Could not upload to https://api.bintray.com/content/ajoberstar/libraries/grgit/0.1.0-SNAPSHOT/org/ajoberstar/grgit/0.1.0-SNAPSHOT/grgit-0.1.0-SNAPSHOT-sources.jar: HTTP/1.1 400 Bad Request
Uploading to https://api.bintray.com/content/ajoberstar/libraries/grgit/0.1.0-SNAPSHOT/org/ajoberstar/grgit/0.1.0-SNAPSHOT/grgit-0.1.0-SNAPSHOT-javadoc.jar...
Could not upload to https://api.bintray.com/content/ajoberstar/libraries/grgit/0.1.0-SNAPSHOT/org/ajoberstar/grgit/0.1.0-SNAPSHOT/grgit-0.1.0-SNAPSHOT-javadoc.jar: HTTP/1.1 400 Bad Request
Uploading to https://api.bintray.com/content/ajoberstar/libraries/grgit/0.1.0-SNAPSHOT/org/ajoberstar/grgit/0.1.0-SNAPSHOT/grgit-0.1.0-SNAPSHOT-groovydoc.jar...
Could not upload to https://api.bintray.com/content/ajoberstar/libraries/grgit/0.1.0-SNAPSHOT/org/ajoberstar/grgit/0.1.0-SNAPSHOT/grgit-0.1.0-SNAPSHOT-groovydoc.jar: HTTP/1.1 400 Bad Request
Uploading to https://api.bintray.com/content/ajoberstar/libraries/grgit/0.1.0-SNAPSHOT/org/ajoberstar/grgit/0.1.0-SNAPSHOT/grgit-0.1.0-SNAPSHOT.pom...
Could not upload to https://api.bintray.com/content/ajoberstar/libraries/grgit/0.1.0-SNAPSHOT/org/ajoberstar/grgit/0.1.0-SNAPSHOT/grgit-0.1.0-SNAPSHOT.pom: HTTP/1.1 400 Bad Request
:bintrayUpload (Thread[main,5,main]) completed. Took 4.291 secs.

Bintray API key with open source project

Hi, I've got a small Groovy library I'm publishing to Bintray using the Maven publish plugin with the Bintray plugin. It's great!

At the moment I'm pushing my build config to the remote repository with the user and key omitted:

bintray {
    user = ''
    key = ''
    ...
}

Is there a sensible way of retaining those settings on my dev machine without having to manually edit the build.gradle each time I want to release? I guess environment variables would be ideal...

Cheers
Ryan

Separate task to just publish released artifacts

Working on Continuous Delivery in my project I would like to be able to release my artifacts to Bintray, run smoke testing on the build (with configured staging repository to use that version) and only if there is everything ok automatically publish the artifacts (also to jcenter).

Currently I would probably have to use Bintray REST API to do that. I would be much easier (having everything already configured in my Gradle build) to just call another task (e.g. bintrayPublish).

Upload task fails the first time

When invoking :bintrayUpload for the first time ever on a project, a new package is created but the task will fail immediately as it can't upload the artifacts. An exception appears on the console

Execution failed for task ':bintrayUpload'.
> groovyx.net.http.HttpResponseException: Forbidden

Calling :bintrayUpload a second time makes it work as the package is already created.

Help needed

What is the most likely explanation for this error:

Some problems were found with the configuration of task ':bintrayUpload'.

No value has been specified for property 'user'.
No value has been specified for property 'apiKey'.
No value has been specified for property 'repoName'.
No value has been specified for property 'packageName'.

The same gradle build woked perfectly the day before,
nothing changed (apparently).

Thanks in advance for the help!

bintrayUpload tasks for different modules

I have several libraries as different modules in my Android Studio project, which I want to publish to bintray. However, running the "gradle bintrayUpload" command tries to upload the first module, fails because that version is already published (HTTP 409) and stops without even considering publishing the other following library modules.
Is there some kind of workaround for that issue, other than creating a separate project for each library?

Depending on 'publish_____PublicationToMavenLocal' instead of 'publishToMavenLocal' breaks plugin in Gradle 2.4+

The bintray plugin is broken on Gradle 2.4+, because the task that bintrayUpload is trying to depend on doesn't exist until after bintrayUpload tries to depend on it, throwing a NullPointerException. This isn't a bug in Gradle 2.4 as far as I understand; rather it's due to Gradle moving more tasks to the new model API.

  1. Bintray configuration should depend on publication artifacts, not local install
  2. If it must depend on local install, then it should use the main 'publishToMavenLocal' task. This could cause extra publications to get installed locally, but I don't see a clean way to handle this otherwise without breaking backwards compatibility.

Better Error Handling

I'm trying to upload my project to Bintray, and getting this error:

Caused by: groovyx.net.http.HttpResponseException: Method Not Allowed
    at groovyx.net.http.HTTPBuilder.defaultFailureHandler(HTTPBuilder.java:652)
    at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:508)
    at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:441)
    at groovyx.net.http.HTTPBuilder.request(HTTPBuilder.java:373)
    at groovyx.net.http.HTTPBuilder$request.call(Unknown Source)
    at com.jfrog.bintray.gradle.BintrayUploadTask$_bintrayUpload_closure4.doCall(BintrayUploadTask.groovy:151)
    at com.jfrog.bintray.gradle.BintrayUploadTask$_bintrayUpload_closure4.doCall(BintrayUploadTask.groovy)
    at com.jfrog.bintray.gradle.BintrayUploadTask.bintrayUpload(BintrayUploadTask.groovy:192)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
    ... 50 more

Looking at this line of code, it's not clear what the problem is:
https://github.com/bintray/gradle-bintray-plugin/blob/master/src/main/groovy/com/jfrog/bintray/gradle/BintrayUploadTask.groovy#L151

Is there any suggestion how to do identify what the problem is? If so, I'll add some improved error handling and submit an pull request.

pom's upload path is coupled with project name (old publication)

Hey,

This plugin is gorgeous. Thanks!!!

I'm using the old-style 'maven' plugin for now. The pom file is released with a wrong path because my project name is different than the artifact I'm trying to publish. My project is 'mockito' the artifact is 'mockito-core'. This makes the pom uploaded into 'org/mockito/mockito' instead of 'org/mockito/mockito-core'.

Another reason to start using new publication plugin :D

I'm reporting for the sake of documenting it. Feel free to skip/close this as it applies to old style 'maven' plugin publications anyway.

Hope that helps!

Better logging messages

BintrayPlugin has a series of logging statements such as Publication {} not found in project.. It's frustrating to see this type of messages in a multi-project setup with excluded artifacts, i.e, some projects do not expose artifacts (think documentation subproject). It would be better if the resolved project name be used in the message too.

This affects the Griffon setup (more than 34 subprojects) where there are at least 14 projects that do not generate jars that must be published.

Support versionDate in configuration

You can programmatically specify a description but not a release date. Does the plugin uses today internally or is this value left unspecified?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.