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

Upload Uri Interpolation Problem on Gradle 4.8 #234

Closed
sghill opened this issue May 31, 2018 · 6 comments · Fixed by palantir/conjure-java-runtime#728 · May be fixed by #235
Closed

Upload Uri Interpolation Problem on Gradle 4.8 #234

sghill opened this issue May 31, 2018 · 6 comments · Fixed by palantir/conjure-java-runtime#728 · May be fixed by #235

Comments

@sghill
Copy link

sghill commented May 31, 2018

Hello,

While running on Gradle 4.8-rc-2, I noticed the upload uri is being constructed incorrectly:

Could not upload to 'https://api.bintray.com/content/nebula/gradle-plugins/gradle-ospackage-plugin/4.9.0-rc.2/value: com/netflix/nebula/value: gradle-ospackage-plugin/value: 4.9.0-rc.2/value: gradle-ospackage-plugin-value: 4.9.0-rc.2.pom'

I debugged this locally and found that an internal api is being used at BintrayUploadTask.groovy#634. This api used to return the groupId, artifactId, and version attributes as a String, but it is now org.gradle.api.provider.Property<String>.

Fortunately, groupId, artifactId, and version are all available on the public MavenPublication interface as Strings, so this can be fixed in a backwards-compatible way.

See also jfrog/build-info#166.

@sghill
Copy link
Author

sghill commented Jun 4, 2018

Here's a build.gradle that reproduces this problem:

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

group = 'com.example'
version = '0.1.0'

publishing {
  publications {
    ourPublication(MavenPublication) {
      from components.java
    }
  }
}

bintray {
  user = 'none'
  key = 'none'
  publications = ['ourPublication']
  pkg {
    repo = 'generic'
    name = 'example'
    licenses = []
    vcsUrl = 'https://github.com/sghill/bintray-example.git'
  }
  dryRun = true
}

settings.gradle:

enableFeaturePreview('STABLE_PUBLISHING')
rootProject.name='example-project'

The output:

> Task :bintrayUpload
Caching disabled for task ':bintrayUpload': Caching has not been enabled for the task
Task ':bintrayUpload' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
Gradle Bintray Plugin version: 1.8.0
Package 'example' does not exist. Attempting to create it...
(Dry run) Created package 'none/generic/example'.
Version 'none/generic/example/0.1.0' does not exist. Attempting to create it...
(Dry run) Created version 'none/generic/example/0.1.0'.
Uploading to https://api.bintray.com/content/none/generic/example/0.1.0/value: com/example/value: example-project/value: 0.1.0/value: example-project-value: 0.1.0.jar...
(Dry run) Uploaded to 'https://api.bintray.com/content/none/generic/example/0.1.0/value: com/example/value: example-project/value: 0.1.0/value: example-project-value: 0.1.0.jar'.
Uploading to https://api.bintray.com/content/none/generic/example/0.1.0/value: com/example/value: example-project/value: 0.1.0/value: example-project-value: 0.1.0.pom...
(Dry run) Uploaded to 'https://api.bintray.com/content/none/generic/example/0.1.0/value: com/example/value: example-project/value: 0.1.0/value: example-project-value: 0.1.0.pom'.
:bintrayUpload (Thread[Task worker for ':',5,main]) completed. Took 1 mins 2.382 secs.

I think a change like this one would move to public apis and just work.

@tiurikov
Copy link

tiurikov commented Jun 5, 2018

Hey there! Any updates from JFrog team? Looks like a blocker for everyone who releases using gradle-bintray-plugin and gradle 4.8.

@eyalbe4
Copy link
Contributor

eyalbe4 commented Jun 5, 2018

@tiurikov and @emkidwell,
We're currently working on the compatibility fix.
We will release a fix by the end of the week (hopefully sooner).

@AlexeiVainshtein
Copy link
Contributor

Hi @tiurikov and @emkidwell,

I just wanted to let you know that we have released a new version (1.8.1) that should resolve the issues with Gradle 4.8. Can you please try with the new version and let us know the outcome?

Thanks,

@warnyul
Copy link
Contributor

warnyul commented Jun 11, 2018

I tested with my android-maven-publish plugin. I created a release with Gradle 4.8 and bintray 1.8.1 a few hours ago

@tiurikov
Copy link

@AlexeiVainshtein, it works well for me! Thank for the fix!

@eyalbe4 eyalbe4 closed this as completed Jun 11, 2018
nilskp added a commit to hazelcast/hazelcast-scala that referenced this issue Jun 14, 2018
dai0304 added a commit to dai0304/aws-client-spring-boot-configuration that referenced this issue Aug 18, 2018
4.8.x has bintray URL interpolation problem bintray/gradle-bintray-plugin#234
4.9 has compatibility problem with lombok https://stackoverflow.com/questions/51375052/gradle-4-9-lombok-1-18-0-fails
dbes-gds added a commit to alphagov/verify-stub-idp that referenced this issue Nov 28, 2018
SergeyZh pushed a commit to JetBrains/intellij-community that referenced this issue Dec 9, 2018
Fixes "message:Unable to upload files: Maven group, artifact or version defined in the pom file do not match the file path" error
bintray/gradle-bintray-plugin#234
lovef added a commit to lovef/gradle-git-version-plugin that referenced this issue Feb 9, 2019
Apply updated bintray plugin for fix
bintray/gradle-bintray-plugin#234
lovef added a commit to lovef/gradle-git-version-plugin that referenced this issue Feb 9, 2019
Apply updated bintray plugin for fix
bintray/gradle-bintray-plugin#234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants