Is it possible to export the gradle dependency cache to the local .m2?


(Matt Bellinger) #1

The company I work for has a process for submitting software for release that requires that the builds be able to be run ‘offline’. While in development I am using a proxied maven repository to maven central. What I would like to do is run a build on my development machine so it pulls down all of the third party artifacts from mavent central, then be able to ‘zip up’ those to give to our CM department so they can extract them to be able to build offline. The issue I have is that gradle has its own cache. So I can’t just point the build script to the local .m2 to resolve dependencies.

Is there a way I can ‘export’ the gradle cache to a maven repository so that I could zip up the artifacts for an offline build?


(Peter Niederwieser) #2

No there isn’t. What you could perhaps do is to have a separate (virtual?) repository for the build, and ask the repository manager to export that repository as, say, a zipped-up Maven repository.


(Matt Bellinger) #3

That was my backup plan, so that is what I will do. Thank you.


(Peter Niederwieser) #4

Perhaps you could automate the repository export by writing a Gradle task that interacts with the repository manager via, say, the latter’s REST API.


(Stig Kleppe-Jørgensen) #5

Can’t this be done by simply having a task that iterates over all the project’s dependencies and zips them up?