Given this Gradle file:
apply plugin: 'java'
apply plugin: 'war'
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">
<info organisation=""
module="gradleTestProj"
revision="unspecified"
status="integration"
publication="20121128085624"
/>
<configurations>
<conf name="archives" visibility="public" description="Configuration for archive artifacts."/>
<conf name="compile" visibility="private" description="Classpath for compiling the main sources." extends="providedCompile"/>
<conf name="default" visibility="public" description="Configuration for default artifacts." extends="runtime"/>
<conf name="providedCompile" visibility="private" description="Additional compile classpath for libraries that should not be part of the WAR archive."/>
<conf name="providedRuntime" visibility="private" description="Additional runtime classpath for libraries that should not be part of the WAR archive." extends="providedCompile"/>
<conf name="runtime" visibility="private" description="Classpath for running the compiled main classes." extends="compile,providedRuntime"/>
<conf name="testCompile" visibility="private" description="Classpath for compiling the test sources." extends="compile"/>
<conf name="testRuntime" visibility="private" description="Classpath for running the compiled test classes." extends="runtime,testCompile"/>
</configurations>
<publications>
<artifact name="gradleTestProj" type="war" ext="war" conf="archives"/>
<artifact name="gradleTestProj" type="jar" ext="jar" conf="runtime"/>
</publications>
</ivy-module>
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:
<publications>
<artifact name="gradleTestProj" type="jar" ext="jar" conf="archives,runtime"/>
</publications>
Is this behavior intended? Is there a workaround for it?