I’m trying to use a new publishing mechanism (‘ivy-publish’ plugin) for uploading files to an ivy repository. In a publication I don’t use ‘from components.java’ or ‘from components.web’ since my project is neither web nor java. Files are added to the publication via the artifact() mechanism, eg: apply plugin: ‘base’ apply plugin: ‘ivy-publish’
version = ‘0.0.1’ group = ‘anygroup’
task wrapper(type: Wrapper) {
gradleVersion = ‘1.6’ }
repositories {
mavenCentral() }
configurations {
myConfiguration }
// Declare some dependency for testing purposes dependencies {
Currently, there’s no DSL for additing/editing dependencies in your publication. You have 3 options:
Use the ‘withXml’ hook to add dependencies to the generated ivy.xml file 2. Create your own SoftwareComponent that will generate the correct publication. (Completely internal and unsupported at the moment). 3. Contribute to Gradle by helping out with the implementation of this story.
The first option is probably the simplest. Naturally, the third option would be my preference :). I’m happy to help out if you choose to contribute.
Is it possible to use a wildcard when specifying the artifact name? I’m doing something very similar - publishing an non Java/Web artifact to Ivy however the task generating my artifacts (a JavaExec task) produces different file names each time it runs.
But this fails as the file path is being evaluated at configuration time (I think) so the build directory is empty when this runs. I get the error ‘Expected directory ‘build’ to contain exactly one file, however, it contains no files.’