title: Installing Tycho via Maven with offline flag
body: <p>I want to run Tycho in an offline environment. Therefore, I mirrored a <a href="https://github.com/eclipse/tycho-demo" rel="nofollow">demo repository on GitHub</a> and executed the command <code>mvn clean install</code> on a computer with internet access. The build succeeded, however when I try to run <code>mvn -o install</code> to install all dependencies in offline mode, I recieve the following exception:</p>
  
  <pre><code>C:\Users\user\Documents\MVN_Test\itp01&gt;mvn clean -e -o install
  [INFO] Error stacktraces are turned on.
  [INFO] Scanning for projects...
  [WARNING] No explicit target runtime environment configuration. Build is platform dependent.
  [INFO] Computing target platform for MavenProject: tycho.demo.itp01:tycho.demo.itp01:1.0.0-SNAPSHOT @ C:\Users\user\Documents\MVN_Test\itp01\tycho.demo.itp01\pom.xml
  [INFO] Adding repository http://download.eclipse.org/releases/helios
  [ERROR] Internal error: java.lang.RuntimeException: Failed to load p2 repository with ID 'helios' from location http://download.eclipse.org/releases/helios: Repository system is offline and no local cache available for http://download.eclipse.org/releases/helios -&gt; [Help 1]
  org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Failed to load p2 repository with ID 'helios' from location http://download.eclipse.org/releases/helios
          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:121)
          at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
          at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
          at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:497)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
  Caused by: java.lang.RuntimeException: Failed to load p2 repository with ID 'helios' from location http://download.eclipse.org/releases/helios
          at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.loadMetadataRepository(TargetPlatformFactoryImpl.java:302)
          at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.gatherExternalInstallableUnits(TargetPlatformFactoryImpl.java:270)
          at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:176)
          at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:128)
          at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:1)
          at org.eclipse.tycho.p2.manager.ReactorRepositoryManagerImpl.computePreliminaryTargetPlatform(ReactorRepositoryManagerImpl.java:84)
          at org.eclipse.tycho.p2.resolver.P2DependencyResolver.computePreliminaryTargetPlatform(P2DependencyResolver.java:223)
          at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject(DefaultTychoResolver.java:109)
          at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:95)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:266)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
          ... 11 more
  Caused by: org.eclipse.equinox.p2.core.ProvisionException: Repository system is offline and no local cache available for http://download.eclipse.org/releases/helios
          at org.eclipse.tycho.p2.remote.RemoteRepositoryCacheManager.createCache(RemoteRepositoryCacheManager.java:57)
          at org.eclipse.equinox.internal.p2.metadata.repository.SimpleMetadataRepositoryFactory.getLocalFile(SimpleMetadataRepositoryFactory.java:66)
          at org.eclipse.equinox.internal.p2.metadata.repository.SimpleMetadataRepositoryFactory.load(SimpleMetadataRepositoryFactory.java:88)
          at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.factoryLoad(MetadataRepositoryManager.java:57)
          at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:768)
          at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:668)
          at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:96)
          at org.eclipse.tycho.p2.remote.RemoteMetadataRepositoryManager.loadRepository(RemoteMetadataRepositoryManager.java:61)
          at org.eclipse.tycho.p2.remote.RemoteMetadataRepositoryManager.loadRepository(RemoteMetadataRepositoryManager.java:53)
          at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.loadMetadataRepository(TargetPlatformFactoryImpl.java:298)
          ... 22 more
  [ERROR]
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR]
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException
  </code></pre>
  
  <p>I have found the following information, these may be a <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=479355" rel="nofollow">bug</a>: </p>
  
  <blockquote>
    <p>Demo project which demonstrates offline build failure</p>
    
    <p>The problem is reproducible always with the following steps:</p>
    
    <ol>
    <li>rm -rf ~/.m2/repository</li>
    <li>unzip demo-project.zip</li>
    <li>cd mvn-demo-parent/releng</li>
    <li>mvn clean install</li>
    <li>Build succeeds</li>
    <li>mvn clean -o clean install</li>
    <li>Build fails because "Repository system is offline and no local cache available for http:// download.eclipse.org/releases/mars"</li>
    </ol>
  </blockquote>