For the new publishing model (“ivy-publish”) starting in Gradle 1.5, it appears the default ivy.xml no longer provides a configuration to obtain the artifact without transitive dependencies. This is the configuration Maven and Ivy call “master” and historically Gradle has published as “archives.”
Take this 1.4 example:
apply plugin: ‘java’
apply plugin: ‘ivy-publish’
group “missing-archives-example”
version “latest”
publishing {
publications {
ivy
}
repositories {
ivy {
url “local-repo”
}
}
}
This produces an ivy.xml with an “archives” configuration that is not transitive:
<?xml version=“1.0” encoding=“UTF-8”?>
<ivy-module version=“2.0” xmlns:m=“http://ant.apache.org/ivy/maven”>
<info organisation=“missing-archives-example”
module=“ivypublishing”
revision=“latest”
status=“integration”
publication=“20130703112232”
/>
<configurations>
<conf name=“archives” visibility=“public” description=“Configuration for archive artifacts.”/>
<conf name=“compile” visibility=“private” description=“Classpath for compiling the main sources.”/>
<conf name=“default” visibility=“public” description=“Configuration for default artifacts.” extends=“runtime”/>
<conf name=“runtime” visibility=“private” description=“Classpath for running the compiled main classes.” extends=“compile”/>
</configurations>
<publications>
<artifact name=“ivypublishing” type=“jar” ext=“jar” conf=“archives,runtime”/>
</publications>
</ivy-module>
Now take a similar 1.5 example, modified slightly to support the new syntax:
apply plugin: ‘java’
apply plugin: ‘ivy-publish’
group “missing-archives-example”
version “latest”
publishing {
publications {
ivy (IvyPublication) {
from components.java
}
}
repositories {
ivy {
url “local-repo”
}
}
}
This produces an ivy.xml with no “archives” or “master” configuration. There are no dependencies in this project, but if there were they would be in the runtime configuration, which would make it impossible to download just the artifact (w/o dependencies).
<?xml version=“1.0” encoding=“UTF-8”?>
<ivy-module version=“2.0”>
<info organisation=“missing-archives-example” module=“ivypublishing” revision=“latest” status=“integration” publication=“20130703112534”/>
<configurations>
<conf name=“default” visibility=“public” extends=“runtime”/>
<conf name=“runtime” visibility=“public”/>
</configurations>
<publications>
<artifact name=“ivypublishing” type=“jar” ext=“jar” conf=“runtime”/>
</publications>
<dependencies/>
</ivy-module>
I could modify the ivy.xml by hand using the descriptor{} approach, but I’d like to know if the Gradle DSL supports this, or if it was removed (by accident or on purpose).
I should note also that publishing WARs (using “from components.web”) does produce an artifact in a “master” configuration.