[GRADLE-2966] Publishing is not yet able to resolve a dependency on a project with multiple different publications Created: 26/Nov/13 Updated: 23/Dec/16 Resolved: 23/Dec/16 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | ||
Reporter: | Gradle Forums | Assignee: | Unassigned |
Resolution: | Duplicate | Votes: | 12 |
Description |
Essentially trying to do what [1]https://github.com/gradle/gradle/blob... does (thanks Peter!). This is part of a multi-project build. One project (hibernate-core) defines 2 publishing, Another project (hibernate-c3p0) defines just one publishing, and has a dependency on hibernate-core. I end up getting an error from Gradle in regards to hibernate-c3p0: A problem occurred configuring project ':hibernate-c3p0'. In terms of the docs sample, I have the reverse relationship. The doc sample has project2 depend on project1 where project1 only defines the one publishing. How can I get this working? Or is this a limitation in publishing? |
Comments |
Comment by Gradle Forums [ 26/Nov/13 ] |
I'm afraid you are hitting a known limitation of the incubating `maven-publish` plugin. I expect this limitation to go away before the plugin gets promoted. |
Comment by Gradle Forums [ 26/Nov/13 ] |
Any Jira I can watch? |
Comment by Steve Ebersole [ 23/Mar/15 ] |
Does this work yet in any version of Gradle? |
Comment by Steve Ebersole [ 08/Apr/15 ] |
Any word on this yet? |
Comment by Richard Simpson [ 18/Oct/15 ] |
Any news? I just ran into this same problem. Was able to work around it by moving all but one of the publications into a sub-project, but it's a pretty ugly solution. Also a bit worried that this issue was reported almost 2 years ago and there doesn't seem to have been any progress. |
Comment by Nikhil Vaishnavi [ 11/Mar/16 ] |
A workaround which I found for this is not to publish the artifact using the default provided ie. dont use - *components.java *E.g. Should be changed to maven(MavenPublication) { groupId 'org.gradle.sample' artifactId 'project1-sample' version '1.1' artifact sampleJar //create the pom file entry along with it to include the dependencies. } |
Comment by Timothy M. Rodriguez [ 06/Apr/16 ] |
+1 on this issue. It's been open for quite some time.. |
Comment by Dima [ 23/Jul/16 ] |
+1 from me too! This product seems unmaintained @vnikhil@gmail.com could you elaborate on your example? |
Comment by Kenny Moens [ 25/Jul/16 ] |
I've applied the following workaround which seems to work fine until now: publishing { publications { java(MavenPublication) { artifact jar // other stuff - skipped for readability pom.withXml { def dependenciesNode = asNode().appendNode('dependencies') configurations.runtime.allDependencies.each { if (it.group != null && it.name != null) { def dependencyNode = dependenciesNode.appendNode('dependency') dependencyNode.appendNode('groupId', it.group) dependencyNode.appendNode('artifactId', it.name) dependencyNode.appendNode('version', it.version) if (it.excludeRules.size() > 0) { def exclusionsNode = dependencyNode.appendNode('exclusions') it.excludeRules.each { rule -> def exclusionNode = exclusionsNode.appendNode('exclusion') exclusionNode.appendNode('groupId', rule.group) exclusionNode.appendNode('artifactId', rule.module) } } } } } } } } |
Comment by Benjamin Muschko [ 15/Nov/16 ] |
As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub. We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to. Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:
We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle! |
Comment by Steve Ebersole [ 15/Nov/16 ] |
I still "advocate" for this issue. Its a big hurdle in the Hibernate build. |
Comment by Joel Hansell [ 15/Nov/16 ] |
I am still inhibited by this bug - as in, I have to work around it. |
Comment by Kenny Moens [ 19/Dec/16 ] |
Is this issue already moved to GitHub? |
Comment by Timothy M. Rodriguez [ 19/Dec/16 ] |
I also advocate for this issue. |
Comment by Steve Ebersole [ 19/Dec/16 ] |
Will we be getting any kind of notification of the new associated GitHub issue? I have a few issues that should be moved (that I replied to) that I have no idea if they have been moved. |
Comment by Richard Simpson [ 23/Dec/16 ] |
Can someone provide a link to the github version of this issue? I can't seem to find it on https://github.com/gradle/gradle/issues |
Comment by Eric Wendelin [ 23/Dec/16 ] |
@Everyone: I have cloned this issue on GitHub at https://github.com/gradle/gradle/issues/1061 — please subscribe and give your :+1:s there. @Steve: please confirm that you got a notification for this. |
Comment by Eric Wendelin [ 23/Dec/16 ] |
Comment by Steve Ebersole [ 23/Dec/16 ] |
Thanks Eric, I did. I'll apply my +1000 there |