Uploading artifacts which have files() dependencies


(Denis Digtyar) #1

I have two sets of projects which are built by two separate multi-project scripts. But they have some inter-dependencies. My problem is that some of the projects from one set depend on the projects from another set which have file dependencies. What are available ways to export this file dependencies?


(Peter Niederwieser) #2

How do you share the project artifacts themselves? If you publish them to a Maven/Ivy repository, you could do the same for the file dependencies.


(Denis Digtyar) #3

I currently publish projects to Ivy repository using filesystem resolver. But I haven’t found the way to configure file dependencies so that they were published alongside projects. I would appreciate it if you could provide me with link or snippet of code.


(Peter Niederwieser) #4

In a Maven world, you’d manually upload these dependencies once to a repository manager. I’m not aware of a Gradle-provided way to automate this. I guess you could use the Ivy APIs directly, or do it with a file copy. Maybe someone else knows a better way. Note that you might also have to tweak the ivy.xml to reference these dependencies.


(Peter Niederwieser) #5

Actually there seems to be a way to publish arbitrary files, if you are happy to do a bit of coding. In that case you could create your own org.gradle.api.artifacts.PublishArtifact’s and assign them to a configuration inside the project.artifacts {} block.