Closed samtstern closed 8 years ago
This issue and https://github.com/bintray/gradle-bintray-plugin/issues/88 seem to provide the same error message. In both cases, the com.github.dcendents.android-maven Plugin is used with the Bintray Plugin. We will soon update with our investigation results.
@samtstern , I think I know what causes this issue. First of all, since the error message you got from Bintray talks about the pom file, I'm guessing that your pom file fails to be deployed to Bintray (you other build artifacts may be deployed successfully though). The text of the message says: "...Maven group, artifact or version defined in the pom file do not match the file path...". This error might be generated in case your gradle project name does not match the artifact ID as defined in the pom.project closure in your Gradle build script (BTW, if the project name is not defined in the build script, Gradle uses the project directory as the project name). Changing your artifact ID to match the project name should fix this issue. To help troubleshoot this issue (and also to help other maven-android users to upload to Bintray), we added a new example named "android-maven-example" which is available here. Building this example according to the instructions should deploy the artifacts successfully.
@eyalbe4 I'm having the same issue. Unfortunately the artifact ID is different from the project name for a reason (naming of the artifact needs to be different) and changing it to match the project name is not feasible. The exact behavior I'm observing is that my binary artifact (aar) gets deployed to the correct path (group/artifact) however my pom gets deployed to the incorrect path (group is correct, but the artifact id is the project name). I've tried quite a few combinations of things and none of them seem to fix this issue, which is odd because the pom contains the correct details (group/artifact/version) - just the path it's getting deployed to is incorrect.
It looks like it is this section of the BintrayUploadTask, this section always uses the project.name for the POM.
artifacts << new Artifact(name: project.name, groupId: project.group, version: project.version,
extension: 'pom', type: 'pom',
file: new File(getProject().convention.plugins['maven'].mavenPomDir, "pom-default.xml"))
You are correct @INRIX-Owais-Ali. The code indeed adds the pom artifact and names it as the project name. To help us come up with the best solution, can you please share some details about your project? Can you list the names of your build artifacts, including the pom file? Thanks!
One of the artifacts we're producing (first one we're trying to get up on Bintray) is com.inrix.sdk.cache - this is the artifact name. The project name for this artifact is inrix-cache. The produced POM includes the correct details (from the install closure). I worked around this by switching to the publishing closure (which produces the results I want), however since this doesn't have Android support yet I have to manually populate the dependencies in the POM.
Would it be feasible to switch to using the group/version/name from the install closure instead of using the project name/group/version?
pd-for-android is seeing this as well. (See writeup for details.)
Would it be reasonable to base it off project.archivesBaseName instead of project.name? I believe archivesBaseName needs to be overridden to generate the expected source and javadoc jars as well.
That would work, since we are specifying archivesBaseName.
@samtstern, @INRIX-Owais-Ali, @AsturaPhoenix, @joebowbeer and all, We're considering adding the following change to the plugin. It should resolve this issue. The plugin will read the value of the artifactId from the pom file created by the maven-plugin and will use it for the pom artifact name instead of the project.name value used today. We'd appreciate your feedback for this.
That seems reasonable and looks like it will work for my case.
Same here - it meets the requirements and looks reasonable.
archivesBaseName works for pd-for-android. Thanks
It would be nice! Waiting for the release.
Version 1.6 has just been released and it includes the following change (as discussed above): The plugin reads the value of the artifactId from the pom file generated by the maven-plugin and then uses it for the pom artifact name, instead of the project.name value used in previous versions.
Nice update! Can this issue and #103 now be closed?
The issue mentioned by @joebowbeer that we had with on pd-for-android was fixed in version 1.6 which we are currently using.
Thanks for the feedback @tkirshboim :) I'm closing this issue.
When I include the lines
version = "0.1"
andgroup = "pub.devrel"
in my gradle files, I get the following error when runningbintrayUpload
:However when I go on
bintray.com
and check the Files tab, I see exactly what I want to see. When I don't include those lines, thebintrayUpload
task succeeds but I get a bad result (aar
file is under the wrong group and has versionunspecified
).Here is my
build.gradle
:This is my maven.gradle:
And this is my bintray.gradle: