title: Build Gradle repository for offline development
body: <p>I am working on implementing a Gradle build system for a piece of software that has parts that are developed in area without Internet connectivity or the ability to install a Maven/Ivy server (like Nexus).  To support development in these environments, I am putting together a Gradle plugin that allows the generation of an "Offline Workspace".</p>
  
  <p>I originally implemented this functionality by triggering the resolution of each configuration in the project (triggering the download of all dependencies), then traversing the entire dependency tree of each configuration and copying the local cached copy of the dependency into the Offline Workspace.  (A Copy task was generated for each copy operation.)  These JARs would then be referenced using a flatDir repository.</p>
  
  <p>This implementation performed its job using an afterEvaluate block.  While this worked fine in Gradle 2.0, it triggers a deprecation warning in Gradle 2.2.1 because triggering the resolution is somehow seen as modifying a configuration after it has already been resolved (<code>Attempting to change configuration ':core:runtime' after it has been included in dependency resolution. This behaviour has been deprecated and is scheduled to be removed in Gradle 3.0</code>).  In all, this approach feels rather hacky since it also requires me to modify the build.gradle files to explicitly list all transitive dependencies since there are no POM files available to properly specify dependencies.</p>
  
  <p>A more elegant approach seems like it would build a local Maven repository of all dependencies (including POM files, source JARs, javadoc JARs, etc) and then just use the mavenLocal() repository type.  Unfortunately, I'm not sure how to do this properly where I don't need to trigger artifact resolution in order to perform this operation.</p>
  
  <p>Is there some better way that I can achieve the full artifact download into an easy-to-package way than just zipping up my entire $USER_HOME/.gradle directory?</p>