[GRADLE-3162] IvyPublication.configurations{} does not create configurations Created: 05/Sep/14 Updated: 10/Feb/17 Resolved: 10/Feb/17 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | ||
Reporter: | Gradle Forums | Assignee: | Unassigned |
Resolution: | Won't Fix | Votes: | 1 |
Description |
hi there I'm trying to publish a jar , well actually 3 jars - classes,sources and javadoc,by using plugin 'ivy-publish'. But executing 'gradle publish' always ends in: > Could not parse Ivy file file:/C:/dev/ie8-git/services/restgenericclient/build/publications/ivyJava/ivy.xml build.gradle looks as following -> apply plugin: 'java' group = 'tie' compileJava { jar { task sourcesJar(type: Jar, dependsOn: classes) { task javadocJar(type: Jar, dependsOn: javadoc) { artifacts { repositories { dependencies { compile 'com.fasterxml.jackson.core:jackson-core:2.4.2' testCompile 'junit:junit:4.11' publishing { publications { generated xml <?xml version="1.0" encoding="UTF-8"?> Does anybody know how to publish sources & javadoc artefact to my ivy repository? thanks for help. |
Comments |
Comment by Gradle Forums [ 05/Sep/14 ] |
The error is because you are specifying configurations for the artifacts ("sources" and "javadoc") that don't exist. You should use one of the existing configurations unless you have a reason to use a separate configuration. The "runtime" configuration is probably what you want. |
Comment by Gradle Forums [ 05/Sep/14 ] |
Thanks for your answer. I'd like to seperate "runtime" from "sources" configuration. For example in ivy.xml of aopalliance in my local gradle cache (C:\Users\tiezad\.gradle\caches\modules- 2\metadata-2.12\descriptors\aopalliance\aopalliance\1.0\8eb80c2e7e631bf662f14a25bb19e6c0) those two configurations are seperated as well. <?xml version="1.0" encoding="UTF-8"?> classpath, and is not transitive."/> but not the compile classpath." extends="compile"/> and execution phases." extends="runtime"/> is not looked up in a repository."/> Is it possible to add this configuration "sources"? |
Comment by Gradle Forums [ 05/Sep/14 ] |
You should just be able to define those configurations then: configurations { sources javadoc } |
Comment by Gradle Forums [ 05/Sep/14 ] |
Still same error. FAILURE: Build failed with an exception.
I've found a workaround. descriptor.withXml { asNode().configurations[0].appendNode('conf', [name: 'sources', visibility: 'public']) asNode().configurations[0].appendNode('conf', [name: 'javadoc', visibility: 'public']) }This way I can add those two configurations manually to ivy.xml. |
Comment by Gradle Forums [ 05/Sep/14 ] |
Could it be that ivy-plugin doesn't support other configurations than default & runtime? |
Comment by Gradle Forums [ 05/Sep/14 ] |
Looks like a defect. You can work around it as such: publications { artifact(sourceJar) { conf "sources" classifier "sources" }} |
Comment by Gary Hale [ 05/Sep/14 ] |
The following doesn't work on IvyPublication: configurations { But this does: configurations.create('sources') |
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 Benjamin Muschko [ 10/Feb/17 ] |
Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved. |