Open reaperdtme opened 9 years ago
@zaiddag, see my comment for this issue. I think both issues talk about the same thing.
@zaiddag have you found a solution for this?
@skavinvarnan deleted the package entirely, after some time, it'll start working again. Not sure why or how "some time", but it doesn't work right away. >.<
@zaiddag i finally found the problem. you project name (library name) and the artifactId should be same. But this was my case.
@skavinvarnan thank you, you made my day
@skavinvarnan your trick worked :D
According to the feedback in https://github.com/bintray/gradle-bintray-plugin/issues/81 release 1.6 resolves this issue. Please let us know what you think.
Nope. I still get this issue in release 1.6.
To build upon @skavinvarnan answer, make sure that your module name is also in sync with the artifact and libraryName fields.
@chRyNaN: I got it working in the end. I have a project that consists of a single module (an Android library). In the build.gradle
file of the Android module I found I had to specify the group and version doubly as follows to not get the 400 exception:
plugins {
id 'com.jfrog.bintray' version '1.6'
}
apply plugin: 'maven-publish'
apply plugin: 'com.android.library'
group = "${myGroupName}"
version = "${myVersionName}"
publishing {
publications {
MySDK(MavenPublication) {
groupId "${myGroupName}"
version "${myVersionName}"
}
}
}
Thanks for sharing this @adil-hussain-84 ! Will you be able to contribute an Android Gradle project example that uses the Bintray Plugin? Thsi could help others in troubleshooting such issues. We can place the example here.
@eyalbe4 Sure. Good idea. I'll put together a small standalone example that demonstrates using the maven-publish
plugin together with the com.jfrog.bintray
plugin when I get a moment. In the meanwhile, anyone who stumbles across this thread can refer to the build.gradle
and Android/build.gradle
files in the following repository which publishes an Android library to Bintray:
@adil-hussain-84 - does your library also sync with maven central ?
@MangeshKadam The Bintray publication of the library is linked to jcenter. The linking is done via the Bintray web interface.
my case ,l forget this line:
group = publishedGroupId
Solution given by @skavinvarnan still works (I spent a couple of hours trying to figure out what was causing this error)
@skavinvarnan May God bless you
bintrayRepo = 'Your Repo name"' bintrayName = 'Package name' publishedGroupId = 'YOUR GROUP ID' libraryName = 'testlibrary' artifact = 'testlibrary' libraryname and artifact must be same. and also it should match with your library name which was given at the time of creation of Module.
This solution work for me, upgrade from 1.4 to 1.6:
@rafaelje that's a perfect answer.
I'm having the same issue with 1.7.2, but upgrading to 1.8.1 fixes the problem.
@hendraanggrian Thank you. For me, it worked with version 1.7 some weeks ago, but stopped recently. Updating to version 1.8 solved the problem.
Sorry for the 2+ year bump, but I'm having this issue on the latest version (1.8.5). It looks to me like this could be because I have non-top level modules. e.g. my project may look like
api/
build.gradle
impl/
ebean/
build.gradle
neo4j/
build.gradle
build.gradle
Here api
is a top level module and ebean
and neo4j
aren't (they are in the impl
directory). If I try to use this plugin with this project structure the gradle task will fail stating that the ebean
and neo4j
projects had a 400 uploading the pom file, as described in the OP.
Since the top level modules (I have more than one) don't report this error, I assume this is an issue with non top level modules.
EDIT
FWIW I made this task for debugging
task dbg() {
doFirst {
println 'project name: ' + project.name
configurations.archives.allArtifacts.each {
println 'artifact: ' + it.name + ': ' + it.file.name
}
}
}
And here's some example output
> Task :dao-impl:ebean-dao:dbg
project name: ebean-dao
artifact: ebean-dao: ebean-dao-0.0.0.jar
artifact: ebean-dao: ebean-dao-0.0.0-sources.jar
artifact: ebean-dao: ebean-dao-0.0.0-javadoc.jar
So the gradle project name "lines up" with the jar name...
Edit 2:
Nope, moved them out, same error. Not sure why, it's only on those modules. The POM looks right and everything.
<groupId>com.linkedin.datahub-gma</groupId>
<artifactId>ebean-dao</artifactId>
<version>0.0.0</version>
The only difference between this an another "working" pom file is the artifact ID and dependency list, both of which make sense.
Execution failed for task ':ebean-dao:bintrayUpload'.
> Could not upload to 'https://api.bintray.com/content/linkedin/maven/datahub-gma/0.0.0/com/linkedin/datahub-gma/ebean-dao/0.0.0/ebean-dao-0.0.0.pom': HTTP/1.1 400 Bad Request [message:Unable to upload files: Maven group, artifact or version defined in the pom file do not match the file path 'com/linkedin/datahub-gma/ebean-dao/0.0.0/ebean-dao-0.0.0.pom']
Seems to be something else unrelated to gradle since the POM fails to upload via the UI as well. I'll see if I can reach out to jfrog support.
I had the same issue with maven, perhaps it helps you. The solution was to set the version tag explicitly at the maven modules I want to upload.
To update my issue, seems unrelated entirely. I don't know why, but I can only reproduce this when trying to publish version 0.0.0
. Bumping up to any other version works fine.
Not an issue with the plugin, but the server. If this is intentional then at the very least the error message is very unclear.
build.grade
generated pom.xml