title: Running Maven and Sonatype Nexus while offline with no internet connection
body: <p>I am trying to setup a maven environment with nexus so that maven downloads its artifacts from a local Nexus repository. The machine where Maven and Nexus is installed has no internet connectivity for security reasons. </p>
  
  <p>I have a similar configuration on my workstation which does have internet connectivity. I installed Maven and Nexus on both machines. I also updated my local maven settings file in  ~m2/settings.xml as shown below:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;settings xmlns="http://maven.apache.org/POM/4.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"&gt;
    &lt;mirrors&gt;
      &lt;mirror&gt;
        &lt;id&gt;nexus&lt;/id&gt;
        &lt;mirrorOf&gt;*&lt;/mirrorOf&gt;
        &lt;url&gt;http://localhost:8081/nexus/content/groups/public&lt;/url&gt;
      &lt;/mirror&gt;
    &lt;/mirrors&gt;
    &lt;proxies&gt;&lt;/proxies&gt;
    &lt;servers&gt;&lt;/servers&gt;
    &lt;pluginGroups&gt;&lt;/pluginGroups&gt;
    &lt;profiles&gt;
      &lt;profile&gt;
        &lt;id&gt;nexus&lt;/id&gt;
        &lt;!--Enable snapshots for the built in central repo to direct --&gt;
        &lt;!--all requests to nexus via the mirror --&gt;
        &lt;repositories&gt;
          &lt;repository&gt;
            &lt;id&gt;central&lt;/id&gt;
            &lt;url&gt;http://central&lt;/url&gt;
            &lt;releases&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/releases&gt;
            &lt;snapshots&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/snapshots&gt;
          &lt;/repository&gt;
        &lt;/repositories&gt;
        &lt;pluginRepositories&gt;
          &lt;pluginRepository&gt;
            &lt;id&gt;central&lt;/id&gt;
            &lt;url&gt;http://central&lt;/url&gt;
            &lt;releases&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/releases&gt;
            &lt;snapshots&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/snapshots&gt;
          &lt;/pluginRepository&gt;
        &lt;/pluginRepositories&gt;
      &lt;/profile&gt;
    &lt;/profiles&gt;
    &lt;activeProfiles&gt;
      &lt;activeProfile&gt;nexus&lt;/activeProfile&gt;
    &lt;/activeProfiles&gt;
  &lt;/settings&gt;
  </code></pre>
  
  <p>I have run to run a simple "mvn install" on the secure server and it complained about missing dependencies. This is expected because i have not downloaded and uploaded any artifacts onto the repository. </p>
  
  <p>I would like to download the artifacts using my local workstation, zip them up and then upload them on to the Nexus repository on the secure machine. I have run 'mvn install' on my local workstation and everything has been downloaded. Now i need to copy the repository on the local workstation to the secure server. </p>
  
  <p>According to the Nexus documentation, the folder <code>$HOME/sonatype-work</code> is the "storage" location. </p>
  
  <ul>
  <li>Is this folder the only folder i need to copy to the secure server in order to copy the repository? </li>
  <li>Are there any other files i need to worry about? e.g. configuration files?  </li>
  <li>I noticed that by default, Nexus disables the remote repositories. Does this mean that if i leave it as it is i dont need to do anything to prevent it to download anything from the central repository. </li>
  </ul>
  
  <p>Thanks in advance. </p>