[GRADLE-2575] Generated ivy.xml is incorrect for project with 'war' plugin applied Created: 28/Nov/12 Updated: 10/Feb/17 Resolved: 10/Feb/17
Given this Gradle file:
apply plugin: 'java'
And assuming there is some code in src/main/webapps, when running 'uploadArchives' Gradle generates the following ivy.xml:
<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
As you can, see an artifact exists in the section that is never actually created. Worse, the war file is not part of the runtime configuration, so other projects that include this war as a dependency will be unable to locate the actual published artifact.
I need the 'uploadArchives' task to generate an ivy.xml file for the war much the same way it does for a jar. If I convert my project to a jar, it generates a publications sections like so:
Is this behavior intended? Is there a workaround for it?
|Comment by Gradle Forums [ 28/Nov/12 ]|
We're aware of a number of issues with ivy.xml & pom.xml generation for 'war' projects. We're currently working on new plugins for publication that will address these (and other) issues. Gradle 1.3 introduced the first iteration of this new ivy-publish plugin, that gives you the ability to modify the generated ivy.xml file before uploading.
You may be able to use this plugin to workaround the current limitations: in the future this plugin will "just work" for publishing web applications.
|Comment by Ryan Nelson [ 08/Jul/13 ]|
FYI, I believe this problem is resolved as of Gradle 1.5 using the ivy-publish plugin. That plugin no longer creates the jar entry in the ivy.xml as explained in the original post. It also eliminates the dependencies section (which really doesn't make sense for a WAR, which packages its dependencies internally), and replaces the "archives" configuration with a "master" configuration that is inherited by "default".
All of these changes make it possible to include the war as a dependency in another project, so I think this issue can be closed.
|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.