title: Copy Maven repository to another computer
body: <p>Is there some index or cache that needs to be refreshed or deleted when I copy over the Maven repository from another computer?</p>
  
  <p>I would like to copy the local Maven repository from my laptop for use on another computer that is effectively offline.  After copying the files from <a href="https://stackoverflow.com/a/15720575/935154">~/.m2/repository</a> it does not work as expected.  When I execute <code>mvn package -o</code> I get an error that it cannot find one of the artifacts from the new repository:</p>
  
  <pre><code>[ERROR] Failed to execute goal on project [...]: Could not resolve dependencies for project [...]: 
  Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact com.oracle:ojdbc6:jar:11.2.0.3.0 has not been downloaded from it before.
  </code></pre>
  
  <p>But I do have the artifact in the folder at <code>~/.m2/repository/com/oracle/ojdbc6/11.2.0.3.0</code> that was copied in from the other computer. (This particular one is not public; it is stored on our company Nexus server which cannot be reached from the target system.)</p>