bintray / gradle-bintray-plugin

Apache License 2.0
1.28k stars 197 forks source link

Bintray upload throws: could not get unknown property 'conf' error on Kotlin multiplatform projects #256

Closed warnyul closed 4 years ago

warnyul commented 6 years ago

I have the following configuration on my multiplatform projects (android, common, js, native)

apply plugin: 'com.jfrog.bintray'

bintray {
    user = System.getenv('BINTRAY_USER')
    key = System.getenv('BINTRAY_API_KEY')
    override = true // for multi-platform Kotlin/Native publishing
    publications = ['prefessor']
    dryRun = false
    publish = false

    pkg {
        userOrg = 'wupdigital'
        repo = 'wup-digital-maven'
        name = project.name
        licenses = ['Apache-2.0']
        vcsUrl = 'https://github.com/wupdigital/prefessor'
        websiteUrl = 'https://github.com/wupdigital/prefessor'
        issueTrackerUrl = 'https://github.com/wupdigital/prefessor/issues'
        githubRepo = 'wupdigital/prefessor'
        githubReleaseNotesFile = 'CHANGELOG.md'
        labels = [
                'Some tags'
        ]

        version {
            name = project.version
            vcsTag = project.version
            released = new Date()
        }
    }
}

// This is required for K/N publishing
bintrayUpload.dependsOn publishToMavenLocal

// This is for easier debugging of bintray uploading problems
bintrayUpload.doFirst {
    publications = project.publishing.publications.findAll { !it.name.contains('-test') }.collect {
        println("Uploading artifact '$it.groupId:$it.artifactId:$it.version' from publication '$it.name'")
        it
    }
}

bintrayUpload.enabled = isRelease()

When I run bintray upload, I get following error:

Execution failed for task ':prefessor-common:bintrayUpload'.
> Could not get unknown property 'conf' for task ':prefessor-common:bintrayUpload' of type com.jfrog.bintray.gradle.tasks.BintrayUploadTask.

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

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':prefessor-common:bintrayUpload'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipCachedTaskExecuter.execute(SkipCachedTaskExecuter.java:105)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ResolveBuildCacheKeyExecuter.execute(ResolveBuildCacheKeyExecuter.java:79)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
        at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
        at org.gradle.execution.taskgraph.LocalTaskInfoExecutor.execute(LocalTaskInfoExecutor.java:42)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:277)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:262)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:135)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.execute(DefaultTaskPlanExecutor.java:200)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.executeWithWork(DefaultTaskPlanExecutor.java:191)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.run(DefaultTaskPlanExecutor.java:130)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'conf' for task ':prefessor-common:bintrayUpload' of type com.jfrog.bintray.gradle.tasks.BintrayUploadTask.
        at org.gradle.internal.metaobject.AbstractDynamicObject.getMissingProperty(AbstractDynamicObject.java:83)
        at org.gradle.internal.metaobject.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:61)
        at com.jfrog.bintray.gradle.tasks.BintrayUploadTask_Decorated.getProperty(Unknown Source)
        at com.jfrog.bintray.gradle.tasks.BintrayUploadTask$_bintrayUpload_closure2.doCall(BintrayUploadTask.groovy:221)
        at com.jfrog.bintray.gradle.tasks.BintrayUploadTask.bintrayUpload(BintrayUploadTask.groovy:213)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:801)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:768)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)
        ... 33 more
SalomonBrys commented 6 years ago

Workaround:

publications = project.publishing.publications.findAll { !it.name.contains('-test') }.collect {
        println("Uploading artifact '$it.groupId:$it.artifactId:$it.version' from publication '$it.name'")
        it.name // << WORKAROUND IS HERE
    }
ilmat192 commented 5 years ago

It looks like https://github.com/bintray/gradle-bintray-plugin/pull/228 can fix it.

warnyul commented 5 years ago

Probably, it fix it, however there are two typo. See #257

jershell commented 5 years ago

When will you fix the bug? PR waiting more time that 1 year

dotCipher commented 5 years ago

If this is merged, can we cut a bugfix release with it?

neworld commented 5 years ago

This issue is blocking me as well. The workaround is not working using kotlin-dsl.

Him188 commented 4 years ago

Use plugin version 1.8.4-jetbrains-3

asarazan commented 4 years ago

I don't see that plugin version anywhere. Can you give more explanation how to use it?

Also to the Bintray team, what's the hold-up on publishing the merged fix for such an obvious typo in your code?

Him188 commented 4 years ago

I don't see that plugin version anywhere. Can you give more explanation how to use it?

Also to the Bintray team, what's the hold-up on publishing the merged fix for such an obvious typo in your code?

You may need 'kotlin-eap' repository? I'm not sure. You may get help from my project here, see 'build.gradle.kts'

asarazan commented 4 years ago

Ah close actually. Just tracked it down in maven(url="https://dl.bintray.com/jetbrains/kotlin-native-dependencies")

asarazan commented 4 years ago

Still radio silence from Jfrog. Guess it's back to filing jira tickets on Sonatype.

martinbonnin commented 4 years ago

For what it's worth, you can upload to bintray without the bintray plugin, just using the maven-publish plugin. It's working well with multiplatform artifacts and is bundled inside Gradle. For an exemple, you can check https://github.com/paug/openfeedback-android-sdk/blob/master/build.gradle.kts#L86

eyalbe4 commented 4 years ago

Apologies for not being able to attend to this sooner! Version 1.8.5 with https://github.com/bintray/gradle-bintray-plugin/pull/257 is now released.

asarazan commented 4 years ago

Thank you, much appreciated!